Garbage Collection for Systems Programmers

bachmeier no at spam.net
Thu Apr 4 16:34:38 UTC 2024


On Thursday, 4 April 2024 at 16:19:28 UTC, ryuukk_ wrote:

> Congratulation, you just describe the reason why nobody wants 
> to take D seriously when it comes to system language with a GC

That's a different issue though. D's GC can at times become a 
problem, and pretty much everyone that says D should embrace the 
GC also says it should be improved.

In your example, the simple solution is to call `GC.disable()` 
before allocating the array, so it's hardly a problem for the 
cases where this does arise. The real solution is to fix the GC 
so this doesn't happen. And you can use malloc with reference 
counting if you don't want to disable the GC when it's needed.

If we move the GC to a library and make it less convenient to 
use, we've eliminated most scripting usage in return for solving 
edge cases with a simple solution (probably a bug) like the one 
you've presented.


More information about the Digitalmars-d mailing list