blazter
ZoneMemory allocation
November 15, 1999 09:09 AM
What are the advantages of using zone memory allocation like Quake and Doom does ?
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
Popular Topics
Advertisement