From 8723d530b3f7321109e865b09d6ecc00b4a9f4ed Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Wed, 12 May 2004 10:26:41 +0000 Subject: fix bug I missed, somehow --- Src/mem.c | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) (limited to 'Src/mem.c') diff --git a/Src/mem.c b/Src/mem.c index 0a9665d09..b944c4d08 100644 --- a/Src/mem.c +++ b/Src/mem.c @@ -493,18 +493,20 @@ hrealloc(char *p, size_t old, size_t new) n -= n % HEAPSIZE; #ifdef USE_MMAP - /* - * I don't know any easy portable way of requesting - * a mmap'd segment be extended, so simply allocate - * a new one and copy. - */ - Heap hnew; - - hnew = mmap_heap_alloc(&n); - /* Copy the entire heap, header (with next pointer) included */ - memcpy(hnew, h, h->size); - munmap((void *)h, h->size); - h = hnew; + { + /* + * I don't know any easy portable way of requesting + * a mmap'd segment be extended, so simply allocate + * a new one and copy. + */ + Heap hnew; + + hnew = mmap_heap_alloc(&n); + /* Copy the entire heap, header (with next pointer) included */ + memcpy(hnew, h, h->size); + munmap((void *)h, h->size); + h = hnew; + } #else h = (Heap) realloc(h, n); #endif -- cgit v1.2.3