Stewart Stremler wrote:
>..
> What are those calls? I didn't see 'em when I skimmed the code.
me neither, which is what _I was trying to say_ in the next bit
>
>> Something like that would seem sensible, but in memwatch.c:893 (in V2.71)
>> mw = (mwData*) malloc( needed );
>> this code is in
>> void* mwMalloc( size_t size, const char* file, int line) {
>>
>> similarly, mwMalloc_() also calls malloc()
>>
>> So it seems that memwatch does it via a wrapper around standard malloc.
>>
>> But the sequence of defines, proto declarations, and code definitions
>> puzzles me much. (As SS intimated,) it looks circular!
>
> It must be that the #define is for code that uses mwMalloc, but it isn't
> #defined in the code that declares and defines mwMalloc. That way, the
> object file that defines mwMalloc uses the real malloc, and the .o file
> that was compiled with the #include doesn't.
>
Nah, memwatch.c has an include of memwatch.h.
Oh, waitaminute..that's it
memwatch.h has an
#ifndef __MEMWATCH_C
..
which wraps the defines hiding malloc
So SS, thanks for making my head hurt less.
Regards,
..jim
--
[email protected]
http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-lpsg