summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2004-05-12 10:26:41 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2004-05-12 10:26:41 +0000
commit8723d530b3f7321109e865b09d6ecc00b4a9f4ed (patch)
tree8e1c182834d3c671bf7bf2d1d4e42b5acaedf35c
parent10744b66fd8273b2370507f00ab6720bca65e7a3 (diff)
downloadzsh-8723d530b3f7321109e865b09d6ecc00b4a9f4ed.tar.gz
zsh-8723d530b3f7321109e865b09d6ecc00b4a9f4ed.zip
fix bug I missed, somehow
-rw-r--r--Src/mem.c26
1 files changed, 14 insertions, 12 deletions
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