[D-runtime] Proposed changes to GC interface

Sean Kelly sean at invisibleduck.org
Fri Aug 6 14:41:20 PDT 2010


On Aug 6, 2010, at 1:52 PM, Steve Schveighoffer wrote:
> 
>> 
>>> Should you be  able to retrieve the typeinfo a block was allocated with?
>> 
>> Seems  reasonable to expect so.
> 
> What about blocks that are tiny where the TypeInfo pointer would be 33% 
> overhead?  If we're only going to store bits.
> 
> Again, consider the suggestion that when allocating *arrays* we may always need 
> TypeInfo, but when allocating single elements, we may just want to store bits.

But in this case, perhaps the TypeInfo request would just return null?  I was thinking along the same lines.  Basically, have TypeInfo storage be a parallel array allocated on demand, like some of the bitarrays are.  Pages containing small blocks probably wouldn't need TypeInfo since they aren't likely to contain arrays, and I don't imagine people dynamically allocate structs very often (even though structs are what inspired all of this to begin with).


More information about the D-runtime mailing list