Rev 1663 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1663 | Rev 1719 | ||
---|---|---|---|
Line 2928... | Line 2928... | ||
2928 | if (!is_extern_segment(sp)) { |
2928 | if (!is_extern_segment(sp)) { |
2929 | if (is_mmapped_segment(sp)) { |
2929 | if (is_mmapped_segment(sp)) { |
2930 | if (HAVE_MMAP && |
2930 | if (HAVE_MMAP && |
2931 | sp->size >= extra && |
2931 | sp->size >= extra && |
2932 | !has_segment_link(m, sp)) { /* can't shrink if pinned */ |
2932 | !has_segment_link(m, sp)) { /* can't shrink if pinned */ |
2933 | size_t newsize = sp->size - extra; |
- | |
2934 | /* Prefer mremap, fall back to munmap */ |
2933 | /* Prefer mremap, fall back to munmap */ |
2935 | if ((CALL_MREMAP(sp->base, sp->size, newsize, 0) != MFAIL) || |
2934 | if ((CALL_MREMAP(sp->base, sp->size, sp->size - extra, 0) != MFAIL) || |
2936 | (CALL_MUNMAP(sp->base + newsize, extra) == 0)) { |
2935 | (CALL_MUNMAP(sp->base + sp->size - extra, extra) == 0)) { |
2937 | released = extra; |
2936 | released = extra; |
2938 | } |
2937 | } |
2939 | } |
2938 | } |
2940 | } |
2939 | } |
2941 | else if (HAVE_MORECORE) { |
2940 | else if (HAVE_MORECORE) { |