4 ms·
No, I get it, but I mean transparent so that stdlib malloc and free could be used. I understand it's not probably feasible.
by kyberias 13y ago
No, I get it, but I mean transparent so that stdlib malloc and free could be used. I understand it's not probably feasible.
- morpher 13y agoYou could use LD_PRELOAD to load a library that does the replacement[1]. [1] http://stackoverflow.com/a/10008252 http://stackoverflow.com/a/10008252
- rkangel 13y agoYou'd never be able to make it just a drop in replacement, because it's not just about the allocation and freeing. The interesting stuff is specifying the hierarchies so that freeing a higher object frees lower ones too. Existing code using malloc/free wouldn't be doing that.