4 ms·
In this case, since the lines of code that can touch the manually managed object pool are probably few and easily reviewed and audited, I don't have any problem
by KMag 7y ago
In this case, since the lines of code that can touch the manually managed object pool are probably few and easily reviewed and audited, I don't have any problem with your advice.
I realize you're not advocating pervasive use of the technique, but if someone reading this is going to make pervasive use of manually managed object pools in a GC'd language, they should at least consider the possibility of moving to a language with both good language support for manually managed memory and a good ecosystem of tooling around manual memory management.
Manually managed object pools in a language designed around GC don't fully get rid of the costs of GC, and re-expose the program to most of the errors (primarily use-after-free, double-free, and leaks related to poorly reasoned ownership) that motivated so much effort in developing garbage collectors in the first place.