4 ms·
For that reason, most video games allocate large blocks of memory upfront and use their own custom allocators, usually very different from the doug lea malloc()
by codesushi42 7y ago
For that reason, most video games allocate large blocks of memory upfront and use their own custom allocators, usually very different from the doug lea malloc() that iirc new is still a wrapper for. (I'm aware of std::allocator, but that's a whole other topic...)
That is only half of the story. The full story is using a preallocated object pool, and reusing entity objects without ever having to dynamically allocate new instances on demand.