summaryrefslogtreecommitdiff
path: root/src/pkg/runtime/mgc0.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/pkg/runtime/mgc0.c')
-rw-r--r--src/pkg/runtime/mgc0.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/pkg/runtime/mgc0.c b/src/pkg/runtime/mgc0.c
index d01429f34..f0eafe3fd 100644
--- a/src/pkg/runtime/mgc0.c
+++ b/src/pkg/runtime/mgc0.c
@@ -91,8 +91,11 @@ mark(void)
{
G *gp;
- // mark data+bss
- scanblock(0, data, end - data);
+ // mark data+bss.
+ // skip mheap itself, which has no interesting pointers
+ // and is mostly zeroed and would not otherwise be paged in.
+ scanblock(0, data, (byte*)&mheap - data);
+ scanblock(0, (byte*)(&mheap+1), end - (byte*)(&mheap+1));
// mark stacks
for(gp=allg; gp!=nil; gp=gp->alllink) {