One of the next steps in porting Nim to Atari TOS would be doing what osalloc.nim keeps telling me: Port memory manager to your platform. Then I would not have to compile with define:useMalloc and restricted choice of garbage collectors.
Is there any documentation what is expected from osAllocPages, osTryAllocPages and osDeallocPages? Of course, I can infer many things by looking at existing implementations but some sort of specification would still be nice.
For example:
Regards Christian
Atari TOS probably supports enough of Posix to offer mmap so all you need to do is to connect osAllocPages to mmap like the code already does.
Which alignment is expected from the pages returned by osAllocPages?
We require PageSize alignment, defined in lib / system / bitmasks.nim.
Since osDeallocPages gets passed a pointer and a size, is it expected that it can deallocate arbitrary chunks of memory?
We used to assume that but Linux doesn't really support it reliably so such assumptions are not in the code anymore. We only deallocate the pointers we received from osAllocPages directly, we don't deallocate arbitrary chunks.
What's the deal with reallyOsDealloc?
Code for debugging, always true.
Of course, I can infer many things by looking at existing implementations but some sort of specification would still be nice.
Good point, please add this documentation to your PR.