Search Results
!!SpWAN5QZ7rf/vg/530629148#530775324
7/11/2025, 6:39:48 AM
>>530773980
Pointers aren't the problem in general though its malloc. I'd recommend using malloc mostly within the context of generic data structures like lists or dynamic arrays but avoid direct use when not necessary. Here is an image showing how many times I use malloc in around ~8k lines of engine code.
I would avoid using malloc and free liberally (at least DIRECTLY). For example I would never malloc a Game Object directly, it would be part of some other data structure / container like a hashtable. Then my only concern would be allocating the container on start up and freeing on termination.
This is kind of situation of "do as I say not as I do" because I actually overuse malloc myself kek. I think the original Fallout pretty much just used an arena allocator to prevent memory fuckery (if I am remembering correctly).
Pointers aren't the problem in general though its malloc. I'd recommend using malloc mostly within the context of generic data structures like lists or dynamic arrays but avoid direct use when not necessary. Here is an image showing how many times I use malloc in around ~8k lines of engine code.
I would avoid using malloc and free liberally (at least DIRECTLY). For example I would never malloc a Game Object directly, it would be part of some other data structure / container like a hashtable. Then my only concern would be allocating the container on start up and freeing on termination.
This is kind of situation of "do as I say not as I do" because I actually overuse malloc myself kek. I think the original Fallout pretty much just used an arena allocator to prevent memory fuckery (if I am remembering correctly).
Page 1