6 ms·
I had to write my own allocators when I wrote an a postgres language extension in C++ which returned variable length results. This let postgres free the data wh
by danmg 6y ago
I had to write my own allocators when I wrote an a postgres language extension in C++ which returned variable length results. This let postgres free the data when it deemed that the result was no longer being used.
It's not just a relic of the past. This was last year.
- qalmakka 6y agoI'm not talking about allocators or global new/delete, I'm talking about operator new and delete inside of classes, which are arguably almost never used.
- danmg 6y agoObject pools?
- qalmakka 6y agoI think it's much better to define a pool class and just use methods or static functions to get instances instead of overloading new/delete per class - it's much much more clearer and explicit; having your objects not going through the global new and delete mechanisms is a big gotcha.