Re: Problem using .zerofill / -segaddr to create very large segments
Re: Problem using .zerofill / -segaddr to create very large segments
- Subject: Re: Problem using .zerofill / -segaddr to create very large segments
- From: Brian Mastenbrook <email@hidden>
- Date: Mon, 21 Sep 2009 16:57:32 -0500
On Sep 21, 2009, at 4:50 PM, Nat! wrote:
Am 21.09.2009 um 20:12 schrieb Jay Reynolds Freeman:
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
email@hidden
http://brian.mastenbrook.net/
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden