[Issue 4092] broken memory management for COM objects derived from IUnknown

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Sep 27 08:33:07 PDT 2013


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



--- Comment #9 from Rainer Schuetze <r.sagitario at gmx.de> 2013-09-27 08:33:05 PDT ---
> Actually `atomicOp!"+="(count, 1)` could be used as well, no?

Yes, that would be better than a synchronized block.

> Also, this can actually now be:
> return GC.malloc(size, GC.BlkAttr.FINALIZE);

Yes.

Unfortunately the introduction of precise scanning makes it impossible to use
overloading new, because you don't get the actual TypeInfo for the allocation.
I have switched to a template factory method since then:

https://github.com/D-Programming-Language/visuald/blob/master/stdext/com.d#L28

The patch in druntime would make this obsolete.

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