2 ms·
You can disable collections being run, but if the library uses the GC, then it uses the GC! (Lots of D users use a mix of GC and explicit allocation. Each has
by WalterBright 4y ago
You can disable collections being run, but if the library uses the GC, then it uses the GC!
(Lots of D users use a mix of GC and explicit allocation. Each has their best use cases.)
May I ask what your concern is?
- danbolt 4y agoI can’t speak for the parent, but I know there are programs that avoid garbage collection due to pauses affecting the business logic. I think developers in those situations often look to C, C++, or Rust as any particular library you reach for isn’t going to be introducing GC into your program.
- WalterBright 4y agoThe D's GC collection cycle does pause, but it does not run unless the GC is asked to do an allocation. Hence, if you don't do GC allocations, or at least do not do them in your realtime loop, it will not pause. D is not a GC language. It's a language with an optional GC. (It also does not have the code gen compromises that fully GC languages rely on, such as write gates.)