[dmd-internals] Giving better static data limits to the GC

Leandro Lucarella luca at llucax.com.ar
Mon Aug 23 06:36:33 PDT 2010


Steve Schveighoffer, el 23 de agosto a las 05:40 me escribiste:
> There is TypeInfo generated for structs too.  Why couldn't you store the bits 
> for that type in that typeinfo?

Yes, that's what the patch in bug 3463 do. The extra needed space is
proportional to the number of types created (and the size of the types),
but since TypeInfo and ClassInfo are so huge, the overhead wouldn't be
too much. Each type as an image of an instance for the .init property,
the pointer mask needs only type_size/word_size*2 **bits** (well
+ 1 word for the lengtt of the type), that is type_size/word_size/8*2
+ word_size bytes.

If the type infos with their bitmasks are grouped together in the
binary, they might not even use real memory if nobody use them, as the
pages they are in can be swapped out and nobody will notice.

> The only issue I see is the overhead in storing a pointer to typeinfo for a 
> small block (i.e. a 16-byte block adds 4 bytes of overhead to store at most 4 
> bits of pointer info).  For small blocks, you could store the bitmask with the 
> block instead of a pointer to the bitmask.

Please, take a look to the bug report, all that have been discussed.

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

Anyway, this is getting a little off-topic, I was asking for another
thing (separating static data that should be scanned from the one that
shouldn't, I don't know how hard could it be, that that has absolutely
no overhead :).

-- 
Leandro Lucarella (AKA luca)                     http://llucax.com.ar/
----------------------------------------------------------------------
GPG Key: 5F5A8D05 (F8CD F9A7 BF00 5431 4145  104C 949E BFB6 5F5A 8D05)
----------------------------------------------------------------------
Every day 21 new born babies will be given to the wrong parents


More information about the dmd-internals mailing list