After reading a white paper on debugging Palm apps I found on the Palm
DevZone site, I added two things to my program for debugging memory
problems:

First, put a "Word crc = Crc16CalcBlock(NULL, 256, 0);" at the beginning of
my Pilot Main and a "ErrNonFatalDisplayIf(crc != Crc16CalcBlock(NULL, 256,
0), "low mem trashed);" at the end.  I think the idea is that low memory is
not supposed to change during my app and if I accidentally write to a NULL
pointer, this should detect it.  When I run the program in the debugger (R5
w/updated plugin and POSE 2.1d26) I get the warning about accessing low
memory when the program starts.  Strangely, I don't get the warning at the
end of the program and I'm getting the "low mem trashed" alert.

Second, I added calls to "MemHeapFreeBytes()" to the beginning and end to
detect memory leaking.  The numbers are different.

So...

Question 1: Does POSE only warn you the first time you access low memory?

Question 2: Is the use of "MemHeapFreeBytes()" accurate for determining
memory leaks?

Thanks in advance,

-Paul

--
Paul Dugas                                     voice:+1-404-635-8026
Systems Engineering Consultant                   fax:+1-404-635-8001
Contractor for The Georgia DOTs NAVIGATOR     mailto:[EMAIL PROTECTED]
http://georgia-navigator.com                  http://pauld.dugas.com

Reply via email to