summaryrefslogtreecommitdiff
path: root/src/pkg/runtime/mheap.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/pkg/runtime/mheap.c')
-rw-r--r--src/pkg/runtime/mheap.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/pkg/runtime/mheap.c b/src/pkg/runtime/mheap.c
index 8f85b5e09..8661bd2a1 100644
--- a/src/pkg/runtime/mheap.c
+++ b/src/pkg/runtime/mheap.c
@@ -186,6 +186,11 @@ MHeap_Grow(MHeap *h, uintptr npage)
return false;
}
+ if((byte*)v < h->min || h->min == nil)
+ h->min = v;
+ if((byte*)v+ask > h->max)
+ h->max = (byte*)v+ask;
+
// NOTE(rsc): In tcmalloc, if we've accumulated enough
// system allocations, the heap map gets entirely allocated
// in 32-bit mode. (In 64-bit mode that's not practical.)