/uspace/trunk/libc/malloc/malloc.c |
---|
2930,10 → 2930,9 |
if (HAVE_MMAP && |
sp->size >= extra && |
!has_segment_link(m, sp)) { /* can't shrink if pinned */ |
size_t newsize = sp->size - extra; |
/* Prefer mremap, fall back to munmap */ |
if ((CALL_MREMAP(sp->base, sp->size, newsize, 0) != MFAIL) || |
(CALL_MUNMAP(sp->base + newsize, extra) == 0)) { |
if ((CALL_MREMAP(sp->base, sp->size, sp->size - extra, 0) != MFAIL) || |
(CALL_MUNMAP(sp->base + sp->size - extra, extra) == 0)) { |
released = extra; |
} |
} |