At 03:41 AM 3/22/2004, you wrote:
please see the following code:

pData = (UInt8*)MemGluePtrNew(70*1024);
...
MemPtrFree(pData);   //crash!
pData = NULL;

"MemoryMgr.c ,Line 3675",What do it mean?

Somehow, the data that immediately follows or precedes the buffer was corrupted, I'd guess.


If you're doing pointer arithmetic on the pData pointer, make sure that you use Int32-types -- this includes array indices; using a Int16 type could cause a wrap that would write before the pointer by mistake.

Oh... writing 70 * 1024 will fail in your MemGluePtrNew call. Write 70L * 1024L to avoid overflowing Int16 and allocating the wrong amount of memory. Remember that Palm OS 68K apps use 16-bit ints.

-- Ben Combee, senior DTS engineer, PalmSource, Inc.
   Read "Combee on Palm OS" at http://palmos.combee.net/



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

Reply via email to