Sign in to follow this  
VprMatrix89

C++ Vector Heap Bug?

Recommended Posts

VprMatrix89    100
return HeapAlloc(_crtheap, 0, size ? size : 1); I get an exception on this line in malloc.c I'm using vectors extensively and am wondering, if you simply use too many vectors will there be problems? It doesn't seem to matter which type I use, when I use push_back it gives me this error on the nth vector I use.

Share this post


Link to post
Share on other sites
rip-off    10976
Quote:

I'm using vectors extensively and am wondering, if you simply use too many vectors will there be problems?

Almost certainly not. Usually, it is the types you store in the vector or the way you use the vector that is at fault.

Share this post


Link to post
Share on other sites
MaulingMonkey    1728
std::vector is used by an extremely large number of people. The chances of there being a crash-level bug in your local Standard C++ Library implementation are virtually zero, something you can't say for any alternative code you'd write yourself.

It's much more likely the bug lies in your code. We're going to have to actually see some of it to tell you what, specifically, though.

Share this post


Link to post
Share on other sites
Zahlman    1682
Quote:
Original post by VprMatrix89
return HeapAlloc(_crtheap, 0, size ? size : 1);

I get an exception on this line in malloc.c
I'm using vectors extensively and am wondering, if you simply use too many vectors will there be problems?
It doesn't seem to matter which type I use, when I use push_back it gives me this error on the nth vector I use.


Is 'n' an exact number?
Have you tried it with non-class types?
Are you doing anything else at all besides calling functions on the vectors?

Actually, never mind that. We're not psychic; show some code. We can't fix what we can't see.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this