GC.BlkAttr.FINALIZE

Steven Schveighoffer schveiguy at yahoo.com
Fri Feb 28 17:28:07 PST 2014


On Fri, 28 Feb 2014 18:45:50 -0500, Namespace <rswhite4 at googlemail.com>  
wrote:

>> We need a precise GC to get struct dtors to work, the alternative would  
>> be extremely hackish.
>
> Since I expect/fear that such a implementation is not done in the next  
> 12 months: what would be the alternative?

Examine the GC code, and figure out a way to hook the finalizer. Look for  
FINALIZE.

Another crude but effective option would be to wrap the struct in a class.  
May not actually be that bad, depending on the size of the struct (blocks  
come in chunks of 16, 32, 64, etc.).

-Steve


More information about the Digitalmars-d-learn mailing list