Jump to content
  • Advertisement

Archived

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

xan

HEAP error

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

Hi I have a problem in VC++ 6.0 with an allocation and I can''t find the cause.. Somewhere in the code I do a really bad thing with one variable or so; when I debug the code I get the following message in the output window: HEAP[my_program_name.exe]: Invalid allocation size - fffffffc (exceeded 7ffdefff) If someone can tell me what can cause this error or how I could find the way to it (in the code). Breakpoints are no good here.. Sure, I could start watching the behavior of dynamically generated variables, but seems everything ok to me. Thanks

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
check out :

http://www.softwareverify.com/index.html

an industrial strength memory validator. You have a 30 day trial, it''s pretty ez to use. I just tried it myself.

Good Luck!

-ddn

Share this post


Link to post
Share on other sites
I don't remember seeing that, but I'm taking a wild guess that fffffffc is actually suppose to be a signed number, not an unsigned number, so 0xFFFFFFFC = -4. That would imply that somewhere you might be trying to do something like:

char* pCharArray;
pCharArray = new char[SomeCalculatedSize];
and SomeCalculatedSize happens to equal -4, which would be interpreted as an unsigned long, instead of a signed long, which would then equal 4294967292 (~4 gig), which is more memory than you're allowed to allocate. The 0x7FFDEFFF equals 2147348479 (~2 gig) which I believe is the max that any typical Win32 program can allocate.

Hope that helps.

[Edit - I was previously allocating ints, not chars, so my example was actualy allocating 16 gigs, not 4 gigs like I had stated]

[edited by - Agony on January 23, 2004 12:07:55 PM]

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!