[Issue 3463] Integrate Precise Heap Scanning Into the GC

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Jun 27 14:22:01 PDT 2010


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



--- Comment #15 from nfxjfg at gmail.com 2010-06-27 14:21:58 PDT ---
I posted two patches to enable precise GC heap scanning under D1/Tango. All
user programs will make use of the precise scanning; no modifications required.

The dmd patch makes dmd generate an additional field in TypeInfo_Struct and
ClassInfo. These fields point to pointer bitmasks for the referenced type. The
patch is written in such a way, that it won't break unpatched Tango or Phobos1
runtimes. In particular, this means the patched compiler should be useable with
an unpatched Phobos1. (And I don't intend to write a Phobos1 patch. Phobos1 is
deaaaad.)

The tango patch makes use of the generated bitmasks. It is based on dsimcha's
patch. The mark phase and the bitmask format are completely different, but the
brain-drilling changes to add bitmask pointers to the memory blocks are the
same. This patch is also designed in such a way, that the patched runtime can
be used with an unpatched compiler (in this case, it defaults to conservative
scanning). The patch also contains a test program (pm.d) for the compiler
generated bitmasks.

The patch should be able to handle all D types. The internal nodes for
associative arrays are still scanned conservatively. You would have to
dynamically allocate and fill pointer maps for each AA, and I'll just say:
sorry, but no.

Note that the bitmask format is different compared to dsimcha's patch. Now it's
a bitmap, where each bit represents an aligned, pointer sized chunk of memory.

Also, I don't use templated TypeInfos as dsimcha was suggesting. I'm convinced
this approach would slow down compile times and generate masses of bloat. It
also would be hard to implement. The question what the TypeInfo of a TypeInfo
template instance should be was unsolved, too.

-- 
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