4 ms·
All that is missing is a garbage collector. Should be possible to implement one by overriding malloc & friends?
by lpapez 2y ago
All that is missing is a garbage collector. Should be possible to implement one by overriding malloc & friends?
- vidarh 2y agoYou can use the Boehm-Demers-Weiser GC with C. It's conservative, because it has to be with C, so it may/will miss things (it will treat integers etc. as potential pointers, and so avoid freeing anything "pointed to" by them), and so it works best as an extra layer of protection/leak detector, but it can be used as a replacement for freeing memory too.