Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Guest Anonymous Poster

ZoneMemory allocation

This topic is 6890 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Guest Anonymous Poster
What are the advantages of using zone memory allocation like Quake and Doom does ?

blazter

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!