From: Dave D. <dde...@es...> - 2004-07-28 09:38:31
|
Ethan Merritt <merritt@u.washington.edu> writes: >> >> In what sense do you mean the memory use code dies dramatically? > > If you enable CHECK_HEAP_USE, then gnuplot redefines free() > to be an internal function > # define free(x) checked_free(x) > > gp_alloc() allocates extra space and puts a checksum in the allocated > chunk of memory, which is checked when it is freed. > If the chuck was allocated directly with malloc() rather than gp_alloc() > then it doesn't contain this padding, and the attempt to validate this > "extra" space in the allocated chunk produces a segfault. > >> PS: Why isn't gpfree, gp_free; consistent with gp_alloc, etc.? > > I wondered that as well. > It was a long time ago, but my guess is I was looking for some particular leak or scribble, and the code was already using a gp_alloc() wrapper, but was using free() directly. As a quick hack, redefining free() was enough for what I was trying to do. dd -- Dave Denholm <dde...@es...> http://www.esmertec.com |