Faster MemoryPool implementation.