Hello there,
I've watched soon 40 episodes of Handmade Hero (no spoilers please) and got to thinking about how the Memory Arena is stored.
Currently the pointer to the data that the arena manages can be stored far from the meta data (size and used members). Consider code that pushes data to the arena, such as
| InitializeArena(myArena, ...);
for (unsigned int i = 0; i < someNumber; ++i)
{
void* data = createSomeData();
PushArray(myArena, data, ...);
}
|
, wouldn't it then be more cache friendly to store the size and used members as close as the data pointer as possible?
I don't know what logic is done do keep and evict data from the cache so if the question doesn't make sense do let me know :)