src/stdlib/SDL_malloc.c
changeset 2210 1de324fce4e8
parent 2203 fca1cdc673b2
child 2859 99210400e8b9
equal deleted inserted replaced
2209:b292fa4941c6 2210:1de324fce4e8
  3690                     if (HAVE_MMAP && sp->size >= extra && !has_segment_link(m, sp)) {   /* can't shrink if pinned */
  3690                     if (HAVE_MMAP && sp->size >= extra && !has_segment_link(m, sp)) {   /* can't shrink if pinned */
  3691                         size_t newsize = sp->size - extra;
  3691                         size_t newsize = sp->size - extra;
  3692                         /* Prefer mremap, fall back to munmap */
  3692                         /* Prefer mremap, fall back to munmap */
  3693                         if ((CALL_MREMAP(sp->base, sp->size, newsize, 0) !=
  3693                         if ((CALL_MREMAP(sp->base, sp->size, newsize, 0) !=
  3694                              MFAIL)
  3694                              MFAIL)
  3695                             || (CALL_MUNMAP(sp->base + newsize, extra) ==
  3695                             || (CALL_MUNMAP(sp->base + newsize, extra) == 0)) {
  3696                                 0)) {
       
  3697                             released = extra;
  3696                             released = extra;
  3698                         }
  3697                         }
  3699                     }
  3698                     }
  3700                 } else if (HAVE_MORECORE) {
  3699                 } else if (HAVE_MORECORE) {
  3701                     if (extra >= HALF_MAX_SIZE_T)       /* Avoid wrapping negative */
  3700                     if (extra >= HALF_MAX_SIZE_T)       /* Avoid wrapping negative */