Mixins for GC-Flexibility?

Walter Bright newshound at digitalmars.com
Mon Nov 20 20:18:15 PST 2006


Russ Lewis wrote:
> Walter has responded that it is impractical to add these, one reason 
> being the runtime overhead of calling these hooks.  (Sorry, Walter, if 
> I've forgotten other reasons.)

You have to be able to overload assignment to get automated refcounting. 
Plus a bunch of complexity has to be added to the compiler to be able to 
unwind the refcounting if, say, one of the function parameters throws 
before the function gets called. It's uuugly.

If you want refcounting, the easiest way to do it is to do it manually 
by making a COM class (addref and release).



More information about the Digitalmars-d mailing list