[Issue 3463] Integrate Precise Heap Scanning Into the GC

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Sep 15 06:34:12 PDT 2010


http://d.puremagic.com/issues/show_bug.cgi?id=3463



--- Comment #79 from nfxjfg at gmail.com 2010-09-15 06:33:39 PDT ---
Incremental patch:

diff --git a/tango/core/rt/gc/basic/gcx.d b/tango/core/rt/gc/basic/gcx.d
index 93c8078..0f049d7 100644
--- a/tango/core/rt/gc/basic/gcx.d
+++ b/tango/core/rt/gc/basic/gcx.d
@@ -589,9 +589,9 @@ class GC
             // Return next item from free list
             gcx.bucket[bin] = (cast(List*)p).next;
             if( !(bits & BlkAttr.NO_SCAN) )
-                cstring.memset(p + size, 0, binsize[bin] - size);
+                cstring.memset(p + request_size, 0, capacity - request_size);
             //debug(PRINTF) printf("\tmalloc => %x\n", p);
-            debug (MEMSTOMP) cstring.memset(p, 0xF0, size);
+            debug (MEMSTOMP) cstring.memset(p, 0xF0, request_size);
         }
         else
         {

request_size is the size the user requested, while size is request_size + the
pointermap's size. But size can be much smaller than memory block's real size
(= capacity), so you really want to start clearing the memory right after the
user data.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list