How do you dynamically allocate memory in a Mac OS X build?

I would like to dynamically allocate memory from an assembly that is not related to the standard C library. Since brk (2) and sbrk (2) are not available on Mac OS X (10.6.2), what are the alternatives?

(I suppose this is due to a call to Mach, but it seems to be a little documentation)

+5
source share
2 answers

Probably the easiest way to look at the sources of Darwin and see how malloc works inside.

+2
source

It looks like malloc calls mmap, which calls __mmap, which looks like syscall

+2
source

All Articles