On Friday, 2 בMay 2008, Shachar Shemesh wrote:
> Re Choo's comment about memory available through "malloc" working for 
> him - malloc uses "brk(2)" to allocate memory as long as it possibly 
> can.

That was what I always thought. However, I found out lately
that uclibc (in which you can compile one of three different
allocators) uses mmap *exclusively* for heap management
(which makes a lot of sense for MMU-less machines).

I haven't read the code of glibc allocator so I'm not sure about the
exact rules. However, a cursory test (just a single malloc() in an empty
program) has demonstrated (via strace) that the sky is not falling
yet and your assertion about brk(2) remains true in the normal world.

Just to make sure we all know that implementation assumption may
change, especially in our dynamic free software world.


-- 
Oron Peled                             Voice/Fax: +972-4-8228492
[EMAIL PROTECTED]                  http://www.actcom.co.il/~oron
ICQ UIN: 16527398

"Copyright protects Software. Patents protect Software Monopolies."
        http://swpat.ffii.org/

================================================================To unsubscribe, 
send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]

Reply via email to