Hands-On High Performance Programming with Qt 5
上QQ阅读APP看书,第一时间看更新

Stack allocators

We can allocate that memory buffer regularly on the heap, but there's another rather ingenious alternative—if you are careful with your objects' lifetimes, you can also allocate the memory buffer directly on the stack, shaving off the dynamic allocation costs completely! Unsurprisingly, such allocators are called stack allocators.