From: "Richard Coutts" <[EMAIL PROTECTED]>
> From: Chris Tutty
> > One approach for tracking memory overwrites is to add 'sentinel'
> > markers to the beginning and end of each block and check these
> > when you release the block (or at any other time you want to look
> > for memory overwrite).
> >
> > The mechanism for memory problem debugging is to write small
> > functions called something like DebugMemHandleNew,
> > DebugMemHandleFree, etc.  These functions take the same parameters
> > as the system functions but do some extra stuff on each memory alloc
> > and release before calling the system functions.  'Extra stuff' varies
> > depending on the problem you're having, but it might be adding four
> > bytes of marker to the beginning and end of each allocated block, or
> > writing a log of each allocation and release (good for tracking
> > lock/release
> > problems).  You then create a C header that #defines MemHandleNew
> > to  DebugMemHandleNew, etc for each function and add this header to
> > every C file in your project.
>
> Thanks Chris, I definately need to do this.
>
> Does anyone have this code posted somewhere or be willing to share it with
> me?  To say that I'm under a time constraint, would be an understatement.
>
I've emailed you the code I use for memory debugging.  I'm sorry to
say that it's a mess because I've cut it out of a larger framework but
I'm hoping that it will be useful to you by reducing the amount of code
you have to write from scratch.

When I've got time I'll organise it properly and post it on-line because
anyone afflicted with memory corruption or a locking imbalance needs
all the help they can get.

Chris Tutty


-- 
For information on using the Palm Developer Forums, or to unsubscribe, please 
see http://www.palmos.com/dev/support/forums/

Reply via email to