> - Memory leak! We're loosing memory, apparently when moving from one scene
> to another. Lots of it, too (maybe it's just pic_buffer_size != 0 being
> interpreted as "infinite", but I don't think so).
> 
> Reliably finding the memory leak(s) will require slighly modified versions
> of malloc() and friends, unless somebody already has a good tool for that.

Quaoting from the malloc man page:

       Recent  versions of Linux libc (later than 5.4.23) and GNU
       libc (2.x) include a malloc implementation which  is  tun­
       able  via  environment  variables.   When MALLOC_CHECK_ is
       set, a special (less  efficient)  implementation  is  used
       which  is  designed  to be tolerant against simple errors,
       such as double calls of free() with the same argument,  or
       overruns of a single byte (off-by-one bugs).  Not all such
       errors can be proteced against, however, and memory  leaks
       can  result.   If  MALLOC_CHECK_ is set to 0, any detected
       heap corruption is silently ignored; if set to 1, a  diag­
       nostic  is  printed  on  stderr;  if  set to 2, abort() is
       called immediately.  This can be useful because  otherwise
       a  crash may happen much later, and the true cause for the
       problem is then very hard to track down.

Also, check out electric fence (written by bruce perens).  It comes standard
on most linux distros.  Man efence (or libefence, sometmes the man page is
called that, too) for more info on efence.  Basically it puts
write-protected areas around all malloced memory areas so that your program
terminates the moment that you try to write beyond the memory in that chunk.

Is that the sort of stuff that you were looking for, or did I misunderstand?

-Chris


-- 
[EMAIL PROTECTED] -> http://cs.alfred.edu/~lansdoct/
"If I had had more time I would have written a shorter letter." - Pascal
"They laughed at Einstein.  They laughed at the Wright Brothers.  But they
also laughed at Bozo the Clown."  -- Carl Sagan
========== Evil Overlord Quote of the Day (www.eviloverlord.com) =========
167. If I am recruiting to find someone to run my computer systems, and my
choice is between the brilliant programmer who's head of the world's
largest international technology conglomerate and an obnoxious
15-year-old dork who's trying to impress his dream girl, I'll take the
brat and let the hero get stuck with the genius. 

Reply via email to