mirror of
https://github.com/elua/elua.git
synced 2025-01-08 20:56:17 +08:00
Fix compiler warming about unused variable in dlmalloc when !HAVE_MMAP
This commit is contained in:
parent
66272c725b
commit
ed9b7df41a
@ -2433,12 +2433,14 @@ static int sys_trim(mstate m, size_t pad) {
|
||||
if (HAVE_MMAP &&
|
||||
sp->size >= extra &&
|
||||
!has_segment_link(m, sp)) { /* can't shrink if pinned */
|
||||
#if HAVE_MMAP
|
||||
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)) {
|
||||
released = extra;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
else if (HAVE_MORECORE) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user