Top
10°

Data Alignment, Part 2: Objects on The Heap and The Stack

Noel Llopis @ Gamasutra: "Last month we looked at data alignment, how to align static variables, and how to allocate aligned memory on the heap through a simple custom allocator. It's a good start, but we need more than that to be able to use alignment effectively in a game.

This month, I'll wrap up this topic by looking at how to allocate any object on the heap with a given alignment and explore allocations on the stack.

Be warned that this is going to take some digging into the dark, dusty corners of the C++ language. So sit comfortably by the fireplace, grab your trusty copy of the C++ Standard, and let's get started."

Read Full Story >>
gamasutra.com
The story is too old to be commented.