🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

ZoneMemory allocation

Started by
0 comments, last by GameDev.net 24 years, 7 months ago
What are the advantages of using zone memory allocation like Quake and Doom does ?

blazter

Advertisement
I haven't heard the term "zone allocation" before but I'll assume it is the same as memorypooling (somebody correct me if I am wrong ).

Memory allocation is SLOW, dead slow, this is because the system has to search the heap for available memory. If you know you need 10000 structures, each taking up 64 bytes, don't alloc each separately, but alloc 640000 bytes, and do your own memory management within that area.

(The system would essentially create a list of 10000 elements that it would have to search on each new memory allocation, while you could achieve the same with a large indexed array...).

Secondly, there's a memory overhead with each allocation - since you know the size of your internal structures, much of this overhead can be eliminated by allocating large chunks.

/Niels

<b>/NJ</b>

This topic is closed to new replies.

Advertisement