How to destruct class instances allocated by a Region-allocator over a single GC block

Per Nordlöw per.nordlow at gmail.com
Fri Apr 6 21:49:37 UTC 2018


On Tuesday, 3 April 2018 at 09:14:28 UTC, Eduard Staniloiu wrote:
> So, say `reg` is your allocator, your workflow would be
>
> auto obj = reg.make!Type(args);
> /* do stuff */
> reg.dispose(obj); // If Type has a __dtor, it will call 
> obj.__dtor
>                   // and then reg.deallocate(obj)

If I do sucessive calls to reg.make!X where X are different kinds 
of classes of different sizes how does reg.dispose(obj) figure 
out at which address(es) (where emplace filled in the data) the 
objects reside?


More information about the Digitalmars-d-learn mailing list