I wrote:

It seems like you could do this with macros, no?

No. This doesn't do the trick; the place where the memory gets lost is still hidden.

    #ifdef MEM_LEAK_DEBUG
    #define MemLeak_New(x,v,n,t) \
        (v = (t*)MemLeak_New_void(x,(n*sizeof(t))))
    #else
    #define MemLeak_New(x,v,n,t) New(x,v,n,t)
    #endif

    void*
    MemLeak_New_void(int x, int num) {
        char* ptr;
        New(x, ptr, num, char);
        return (void*)ptr;
    }

Are you using the Perl malloc wrappers, Jeremy?

According to perldebguts, Perl's -DL switch is obsolete since 5.6 and programs like Valgrind and Purify are preferred. If that's true, how do the p5p folks hunt down memory leaks when the information Valgrind spits out is so non-specific?

Marvin Humphrey
Rectangular Research
http://www.rectangular.com/

Reply via email to