Hi Carl
> I have an app with numerous calls to calloc. I've included the file #include
> <stdlib.h> which directs to the cstdlib file which in turn holds the
> prototype for calloc.
Palm OS has it's own mem-management, so you should avoid std C mem-functions (e.g.
malloc, calloc, free, ...)
use Palm OS specific functions instead: MemPtrNew(), MemPtrFree().
as workaround you could use something like:
(haven't actually tried it, just sample code)
#define malloc(size) MemPtrNew(size)
#define free(ptr) MemPtrFree(ptr)
MemPtr calloc(Int32 size, UInt8 value)
{
MemPtr ptr;
ptr=MemPtrNew(size);
if (ptr)
MemSet(ptr, size, value);
}
calloc() allocates and initializes the mem so you have to call MemSet() after
allocating.
by(e)
Stephan
--
PGP Fingerprint: 0090 E02F 39A8 F2AF 6A79 43D7 B847 C26D 108E E2F0
PGP PublicKey: http://www.unet.univie.ac.at/~a9526342/sveigl.asc
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/