Re: Problem using .zerofill / -segaddr to create very large segments
site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com On Sep 21, 2009, at 4:50 PM, Nat! wrote: Am 21.09.2009 um 20:12 schrieb Jay Reynolds Freeman: _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/site_archiver%40lists.appl... My problem concerns keeping a block of memory out of the clutches of the storage allocator (malloc, new, et cetera), so that I can use it for mmap. I don't understand the problem completely, but I'd be trying to use mmap + MAP_FIXED to map the region, just right after load. Or doesn't that work as expected ? The problem is that code, the malloc heap, etc. are already placed in memory at that point. Using a zero-fill segment in an object reserves the heap space first, which forces the linker to move any relocatable code and the malloc heap to be allocated elsewhere. This is useful in general for image-based programming languages that are natively compiled, as you can save an image and then re-map it in memory as it was originally represented. -- Brian Mastenbrook brian@mastenbrook.net http://brian.mastenbrook.net/ This email sent to site_archiver@lists.apple.com
participants (1)
-
Brian Mastenbrook