GC feels like this magic box. Does great things for you without having to worry about memory leaks, which is great. But like anything that is magical you give up some control. I guess it's a tradeoff
Well, malloc and free are black boxes as well. And in typical implementations can potentially take arbitrary amounts of time to run, too. (Though they usually don't.)
It depends on your allocator - ptmalloc, the default linux allocator - is open source, and there's plenty of very robust open allocators (jemalloc, mimalloc, tcmalloc, etc). Understanding how your allocator works can be very important in certain contexts.
On windows I'd expect the default allocator to be a black box, but I might be wrong.
For garbage collection I strongly recommend this book (on top of the source code of your gc if available!)
https://gchandbook.org/
eru|4 years ago
Agingcoder|4 years ago
On windows I'd expect the default allocator to be a black box, but I might be wrong.
For garbage collection I strongly recommend this book (on top of the source code of your gc if available!) https://gchandbook.org/