galdar496 / QiGameEngine

Realtime Game Engine designed with C++ and OpenGL.
http://qiengine.blogspot.com/
1 stars 0 forks source link

Per-thread memory allocator #5

Open galdar496 opened 9 years ago

galdar496 commented 9 years ago

The current memory allocator is simply a wrapper around malloc/free...extend this to work for multiple threads by creating a memory pool that gives any requesting thread a 2MB chunk of memory to use. The thread can then use this 2MB chunk to allocate from until full, at which point it'll get another 2MB chunk.