Refactor Memory API to use mmap() syscall. #13

Open
opened 2023-09-05 15:41:04 -05:00 by jordan · 3 comments
Owner

Instead of just being a simple wrapper over malloc(), we might consider using mmap() directly. This might make the memory API more flexible, although it adds a lot more complexity.

Instead of just being a simple wrapper over `malloc()`, we might consider using `mmap()` directly. This might make the memory API more flexible, although it adds a lot more complexity.
jordan added the
enhancement
label 2023-09-05 15:41:04 -05:00
jordan added this to the Telodendria v1.7.0-alpha5 project 2023-09-05 15:41:04 -05:00
Contributor

Wanted to note down that while mmap is indeed POSIX, some exotic platforms' libc might not ship with it, so a way to keep with the "old" malloc-based method as a "second-tier citizen"(or maybe even something à la DOOM, with a large, preallocated area) for stranger platforms

Wanted to note down that while `mmap` is indeed POSIX, some *exotic* platforms' libc might *not* ship with it, so a way to keep with the "old" malloc-based method as a "second-tier citizen"(or maybe even something *à la* DOOM, with a large, preallocated area) for stranger platforms
Author
Owner

Good point. And honestly, this is kind of more wishful thinking for the time being, I might not ever actually get around to doing this. The current method is at no risk of going away any time soon.

That being said, if an OS doesn't have something specified in POSIX, Telodendria is under no obligation to support it. I'm specifically targeting POSIX; trying to beat an OS that isn't POSIX into submission isn't really one of the goals.

Do you have a an example of a system in mind that doesn't have mmap()?

Good point. And honestly, this is kind of more wishful thinking for the time being, I might not ever actually get around to doing this. The current method is at no risk of going away any time soon. That being said, if an OS doesn't have something specified in POSIX, Telodendria is under no obligation to support it. I'm specifically targeting POSIX; trying to beat an OS that isn't POSIX into submission isn't really one of the goals. Do you have a an example of a system in mind that doesn't have `mmap()`?
Contributor

That being said, if an OS doesn't have something specified in POSIX, Telodendria is under no obligation to support it. [...] trying to beat an OS that isn't POSIX into submission isn't really one of the goals.

This is true.

Do you have a an example of a system in mind that doesn't have mmap()?

The only example I could think of at the current moment to be totally frank are really small and hobbyist attempts at making a libc(which again, Telodendria doesn't really have to support those upstream), like this one.

> That being said, if an OS doesn't have something specified in POSIX, Telodendria is under no obligation to support it. [...] trying to beat an OS that isn't POSIX into submission isn't really one of the goals. This is true. > Do you have a an example of a system in mind that doesn't have `mmap()`? The only example I could think of at the current moment to be totally frank are really small and hobbyist attempts at making a libc(which again, Telodendria doesn't really have to support those upstream), like [this one](https://gitea.planet-casio.com/Heath123/fxlibc).
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: Telodendria/Telodendria#13
No description provided.