In article <91176@palm-dev-forum>, [EMAIL PROTECTED]
says...
>
> Hello,
> In the trace file of POSE I see entries like :
>
> 3173.113: Non-relocatable chunk leaked at 0x0003B65A, size = 294
> 3173.113: Chunk allocated by:
> 3173.113: __nw__FUl
> 3173.113: <Unknown @ 0x0007CD8A>
>
> How to identify the actual function name of __nw__FUl?
This is a C++ mangled name. In particular, this is referring to
operator new, which you can see when you disassemble New.cp from the
runtime library.
This is going to be difficult to track, as the memory leak isn't really
from operator new, but from what called it. POSE only tracks the actual
function that did the allocation.
One way to streamline things is to define new and delete as inline
operators. Add these lines to one of your header files:
inline void *operator new(unsigned int size)
{
if (size == 0) size = 1;
return MemPtrNew(size);
}
inline void operator delete(void *ptr)
{
if (ptr) MemPtrFree(ptr);
}
then, your new/delete will be inlined into the function that calls them,
and you'll see the real culprit in the POSE dump. This does change
new/delete behavior slightly, as these inline versions don't throw
exceptions when they fail to allocate memory.
--
Ben Combee <[EMAIL PROTECTED]>
CodeWarrior for Palm OS technical lead
Get help at http://palmoswerks.com/
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/support/forums/