3 ms·
The idea is that this would be used in a language backend, so the compiler would track the roots for you. Note that in C ref counting is also rather error prone
by sirwhinesalot 2y ago
The idea is that this would be used in a language backend, so the compiler would track the roots for you. Note that in C ref counting is also rather error prone in that you can increment or decrement a reference the wrong number of times.
But I agree this is not the best thing to do manually. The main advantage is that you only need to call collect in 1 place in your whole app. A lot easier to get right than having free all over the place.
EDIT: placed your article on my reading list, thanks for sharing it!