From: Stephen M. W. <ste...@cr...> - 2002-06-07 12:54:57
|
On June 7, 2002 01:38 am, Matt Fiedler wrote: > > In any case, I think the most likely thing is that I am mangling > memory management somehow. If anyone could point me toward some > resources to read on how to track such problems down or some tools > that are useful in this endeavor, I'd be very appreciative, and, even > better from your perspective, I could stop wasting your time. :-) Here's a suggestion: use the checked container functions (and add some to your own "matrix" container) to make sure that's not the source of your problem. For example, vector::operator[] is not range checked, but vector::at() will throw an exception if an attempt is made to access memory outside of the valid range. You should add a similar function to your matrix class. You might also consider using standard algorithms (eg. std::for_each, std::transform, std::accumulate) instead of handrolled loops to eliminate the possibility of off-by-one range errors. Those are the most likely sources of arena-trashing code. Good luck. -- Stephen M. Webb |