4 ms·
I would like to use D if I could dump the GC, but it appears they don't make that easy, even though as you say it is possible. For me smart pointers make memory
by ruleabidinguser 9y ago
I would like to use D if I could dump the GC, but it appears they don't make that easy, even though as you say it is possible. For me smart pointers make memory management seem not so daunting.
- bachmeier 9y agoIt's actually pretty easy. Just mark your code as @nogc, and it won't compile if there's anything that could potentially trigger a garbage collection. You obviously lose some functionality this way, but there's nothing difficult about avoiding the GC.
- mhh__ 9y agoThere are smart pointer libaries, and also implementing ref counting is much more straightforward than in C++ because the type system knows whether data is being shared or not. I should add that the GC actually works perfectly fine for normal work, it justs not up to the competition (Partly because of having to work with traditional dynamic memory).