Advice wanted on garbage collection of sockets for c++ programmer using D

Guillaume Piolat via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed Jun 28 05:33:24 PDT 2017


On Wednesday, 28 June 2017 at 11:34:17 UTC, Moritz Maxeiner wrote:
> Requirement: Do not allocate using the GC
> Option 1) Use structs with `@disable this`, `@disable 
> this(this)`, and a destructor that checks whether the resource 
> reference is != invalid resource reference before trying to 
> release.
> Option 2) Use classes with simple constructor/destructor layout.
> If you want to integrate a check that the requirement holds 
> (with either class or struct), put `if (gc_inFinalizer) throw 
> SomeError` into the class/struct destructor

I don't get it.
It's completely possible to use the full power of GC and be 
deterministic.
I'm out of this very _confused_ discussion.


More information about the Digitalmars-d-learn mailing list