Under the Bridge

Custom Allocators

Here’s another of those digging into the runtime guts posts of Mike Ash’s worth reading:

Friday Q&A 2010-12-17: Custom Object Allocators in Objective-C

Finding your allocations too slow? Well, go write your own caching (or whatever) allocator then!

Another good reason to know how to do this, as pointed out in the comments, is if you’re working with crypto code (or any sensitive information, really) and it would be prudent to zero out memory after yourself when dealloced.