Quote:
Originally Posted by NovaCoder
My other problem is that I can't really debug it (or at least step-through the code).
|
When you get a reproduceable crash you should be able to find the crash location, even without a debugger.
What kind of Guru is it? Illegal instruction (80000003) or memory corrupted (81000005), etc?
Also use Enforcer and MungWall or similar tools to provoke memory failures early, and replace AllocMem/calloc by an own function which checks the return value.
Quote:
1) Replacing all the calls from calloc to AllocMem(FAST_MEM) gets it working.
|
Without MEMF_CLEAR? That's strange. Rememer that calloc() will return zeroed memory!
Quote:
2) The code seems to be run though a number of calloc statements before it blows up (reboots the computer!).
|
Oh. So there is no Guru? I guess your program is writing to unallocated memory, or exceeds the limits of the allocated memory chunks.
As stated above, use Enforcer/MungWall. And try to allocate twice the memory requested and see if it changes anything. I guess it's just luck when AllocMem doesn't crash, because the memory is allocated in a different order.