Jump to content
  • Advertisement

Archived

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

Austrian Coder

realloc + memory manager

This topic is 5479 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

Hello! I have written a memory manager. It works fine. But i have one problem. If the pool of memory is full, i want to extend it. Lets say, the memory manger allocates with the constr. 5 MB space. [CMemoryManager MemMng(5242880);] Now i have used all the free space. Now i want to extend it, without destroying the data of the smaller memory pool. Is realloc good for this? How make this?

Share this post


Link to post
Share on other sites
Advertisement
Realloc may move all of your allocations and make all of your pointers invalid. The alternative is to maintain a list of pools or use a memory allocator that supports extending the pool without moving the the data (if one exists).

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!