Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date: Thu, 10 Sep 2015 14:58:33 -0400
From: Yuxin Ren <>
Subject: confusion about brk and mmap in expand_heap in malloc implementation


I found in the __expand_heap function used by malloc, if brk fails, it will
use mmap to get a memory area.
I think in this case, this area should be returned back to system via
But in my test, when I free such area, I found it is still passed to
madvise, not munmap.

How do we track if an area is expanded by brk or mmap?
And when we free an area, how do we decide to use munmap or madvise?

Thanks a lot.

Content of type "text/html" skipped

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.