Date: Thu, 10 Sep 2015 14:58:33 -0400 From: Yuxin Ren <ryx@...ail.gwu.edu> To: musl@...ts.openwall.com Subject: confusion about brk and mmap in expand_heap in malloc implementation Hi, 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 munmap. 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. Yuxin 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.