- Hands-On High Performance Programming with Qt 5
- Marek Krajewski
- 52字
- 2021-07-02 13:54:00
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.