From e95c3fe6d5fcdf6aea5c1591bde176d3039c6559 Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Thu, 29 Mar 2018 10:08:23 -0600 Subject: [PATCH] sgc: fix unmapping of temporary GC space Instead of unmapping directly, return temporary space to the page-allocation cache. --- racket/src/racket/sgc/sgc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/racket/src/racket/sgc/sgc.c b/racket/src/racket/sgc/sgc.c index 5b2abd9179..2b9232a97a 100644 --- a/racket/src/racket/sgc/sgc.c +++ b/racket/src/racket/sgc/sgc.c @@ -1388,7 +1388,7 @@ static void *realloc_collect_temp(void *v, intptr_t oldsize, intptr_t newsize) if (oldsize) memcpy(naya, v, oldsize); if (v) - munmap(v, (oldsize + SECTOR_SEGMENT_SIZE - 1) >> LOG_SECTOR_SEGMENT_SIZE); + free_plain_sector(v, (oldsize + SECTOR_SEGMENT_SIZE - 1) >> LOG_SECTOR_SEGMENT_SIZE, 0); return naya; #elif GET_MEM_VIA_VIRTUAL_ALLOC @@ -1421,7 +1421,7 @@ static void free_collect_temp(void *v, intptr_t oldsize) brk(save_brk); } #elif GET_MEM_VIA_MMAP - munmap(v, (oldsize + SECTOR_SEGMENT_SIZE - 1) >> LOG_SECTOR_SEGMENT_SIZE); + free_plain_sector(v, (oldsize + SECTOR_SEGMENT_SIZE - 1) >> LOG_SECTOR_SEGMENT_SIZE, 0); #elif GET_MEM_VIA_VIRTUAL_ALLOC VirtualFree(v, 0, MEM_RELEASE); #else