#define malloc(x) MemPtrNew(x)
#define free(x) MemPtrFree(x)
#define calloc(a,b) malloc(a*b)

void *realloc(void *ptr, size_t size){
   void* tmp;
   if(MemPtrResize(ptr,size) == errNone) return ptr;
   tmp=MemPtrNew(size);
   if(tmp){
      MemMove(tmp,ptr,size>MemPtrSize(ptr)?MemPtrSize(ptr):size);
      MemPtrFree(ptr);
      return tmp;
   }
   return NULL;
}

On 9/9/07, mrc-dm <[EMAIL PROTECTED]> wrote:
> Hi!
>
> Can be used the functions malloc, free, calloc and realloc in PalmOS?
>
> Thanks
>
> --
> For information on using the ACCESS Developer Forums, or to unsubscribe, 
> please see http://www.access-company.com/developers/forums/
>


-- 
Best Regards,
Dmitry Grinberg
(847) 226 9295

-- 
For information on using the ACCESS Developer Forums, or to unsubscribe, please 
see http://www.access-company.com/developers/forums/

Reply via email to