f8034540a1
Trivial example: #include <stdlib.h> int main(void) { void *ptr = malloc(1024 * 1024 * 8); if (!ptr) return 1; ptr = realloc(ptr, 1024 * 1024 * 4); if (!ptr) return 1; } Before: mmap(NULL, 8388608, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fcfff000000 mmap(NULL, 4194304, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fcffec00000 madvise(0x7fcfff000000, 8388608, MADV_DONTNEED) = 0 After: mmap(NULL, 8388608, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f1934800000 madvise(0x7f1934c00000, 4194304, MADV_DONTNEED) = 0 Closes #134 |
||
---|---|---|
.. | ||
arena.c | ||
atomic.c | ||
base.c | ||
bitmap.c | ||
chunk_dss.c | ||
chunk_mmap.c | ||
chunk.c | ||
ckh.c | ||
ctl.c | ||
extent.c | ||
hash.c | ||
huge.c | ||
jemalloc.c | ||
mb.c | ||
mutex.c | ||
prof.c | ||
quarantine.c | ||
rtree.c | ||
stats.c | ||
tcache.c | ||
tsd.c | ||
util.c | ||
valgrind.c | ||
zone.c |