One tricky thing here is that this does break the normal memory management semantics. That is, while one nice thing about malloc/free is that you can drop pretty much any implementation of a user-space memory allocator in there without changing your code, this is no longer the case. Whatever replacement allocator you use will have to change its interface, and probably its data structure, to fit the new model.
Edit: Also, how is this better than doing something like this
I don't understand why talloc preclues a different malloc/free implementation.
According to the article, talloc is a malloc wrapper. If that's the case, why shouldn't you be able to drop in whatever allocator you want? talloc should still use it under the covers.
Ah, I didn't see it's a wrapper. In that case, what's the point of using it at all? If it doesn't help to optimize the memory allocation, it seems more like a macro and less like a library.
But he doesn't quite make it clear if he wants it done for every memory allocation, or that specific type of allocation. The two have very different results.
Edit: Also, how is this better than doing something like this