Jump to content
  • Advertisement
Sign in to follow this  
Dragon_Strike

Evil Steve MemMgr

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

Ive just added Evil Steves (i think it was) MemMgr header/source to my project... and when i close my application i get an error message "Allocator Broken" from the MemMgr... what might be causing this?

Share this post


Link to post
Share on other sites
Advertisement
That happens if there's a buffer underflow / overflow that's overwriting the allocator's bookkeeping information. If you look up the call stack, you should see what [de]allocation is causing the problem; it's likely to be that one that's causing the buffer underflow / overflow.

You could also try removing allocations until the problem goes away to narrow down the cause, or modifying the memory manager to use larger head and tail sentinals (Currently it's just one size_t at each end of the allocation).

It's also possible that this is an actual bug in my code of course, but I can't see anything that would cause a problem like this.

EDIT: You could also try modifying the InternalAlloc() and InternalDealloc() functions to check the allocation linked list on every [de]allocation, to narrow down where the problem is occuring - the pNext member of the pPrev block from current should equal this. I mean, add something like this at the start of InternalAlloc and InternalDealloc:

AllocHeader* pBlock = m_pHead;
while(pBlock != m_pTail)
{
Assert(pBlock->pNext->pPrev == this, "Found broken block");
pBlock = pBlock->pNext;
}

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • 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!