简体   繁体   中英

How do you dynamically allocate memory in Mac OS X assembly?

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

(I'm guessing that it involves a Mach call, but there seems to be little documentation around that)

可能最容易做的就是查看达尔文的资料 ,看看malloc如何在内部运作。

看起来像malloc调用mmap,它调用__mmap,看起来它只是一个系统调用

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM