Handmade Hero»Forums»Code
The_8th_mage
69 posts / 1 project
Memory arenas
Hello,
Can somebody explain to me how the temporary storage is handled? On the start of the series, casey said it can be zeroed out every frame , though,correct me if i'm wrong, he keeps bitmap and world data there. I would really want to understand it.
Casey Muratori
801 posts / 1 project
Casey Muratori is a programmer at Molly Rocket on the game 1935 and is the host of the educational programming series Handmade Hero.
Memory arenas
The idea is that anything in the transient storage can be regenerated. So if it is zeroed out, it will just rebuild itself, since none of it is "state".

For example, we keep the bitmaps there, but the bitmaps can just be reloaded from the asset file at any time. There is no "state" associated with the bitmaps. So if we lost the transient memory, it wouldn't matter, because it can be completely reinitialized again from the permanent game state without losing anything.

Does that make sense?

- Casey
The_8th_mage
69 posts / 1 project
Memory arenas
well, it makes some sense, but i don't understand where you put the line. maybe it's just experience.
Casey Muratori
801 posts / 1 project
Casey Muratori is a programmer at Molly Rocket on the game 1935 and is the host of the educational programming series Handmade Hero.
Memory arenas
The line is mostly just "what would I need to save if I wanted to restore the state of the program?" So anything like entity state has to get saved, since it cannot be regenerated. Anything like bitmaps doesn't, because it can just be reloaded.

- Casey