Hi all,
I'm having a strange crash using STL vectors. Maybe one of you has
some idea what it is. Note, I'm using the Metrowerks version 6 beta (the
vectors seem to work a lot better under this version). Here is what's
happening:
1) I do some initialization which consists of setting array values
and more importantly, pushing some integers onto an integer vector.
2) Next I do some processing. This creates some vectors, does some
various operations, and returns.
3) Lastly I do the initialization sequence again which seems to
crash during one of the "push_back" operations on the integer vector.
Something like this:
newwallsy.clear();
for(i=0;i<NUM_WALLS;i+)
{
newwallsy.push_back(0);
}
where newwallsy is defined as
vector <int> newwallsy;
and NUM_WALLS is some defined integer value
On the palm, this comes up as a fatal error (the one that displays the reset
button and freezes the palm) and on the emulator it simply gives a
"gremlins" error (an error box that just says "gremlins".
Anyway, since this only crashes the second time I call the routine, I
suspect that I'm running out of memory. Does this sound consistent?
I suppose what I'm looking for is:
1) does this look like an out of memory error?
2) If so, how can I check my free memory to see how much I have?
(right now I'm trying MemHeapFreeBytes, but I'm not sure I'm using it
correctly)
3) If not, does anyone have any ideas what the problem might be?
David Korus
Blevins Enterprises Inc.