[Issue 16982] std.experimental.allocator.make!T must either call GC.addRange or be marked @system
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Sun Dec 18 11:55:16 PST 2016
https://issues.dlang.org/show_bug.cgi?id=16982
--- Comment #2 from Sönke Ludwig <sludwig at outerproduct.org> ---
Yeah, I used to simply `static if (std.traits.hasIndirections!T)
GC.addRange(...);` in vibe.d's allocator module. Using annotations instead of
controlling this at the call site is an interesting idea, although I can see
applications for both approaches.
Using @nogc sounds good, too, although if that approach is taken, I'd propose
to define @nogc as a UDA in object.d instead of adding a new special trait for
detecting its presence.
--
More information about the Digitalmars-d-bugs
mailing list