#include "memory.h" #include "stdlib.h" #include "string.h" short DisposPtr(Ptr mem) { if (mem!=NULL) free((char *)mem-4); return 0; } Ptr NewPtr(long size) { Ptr val; long *storesize; val = malloc((unsigned int)size+4); // leave space for size info if (val==NULL) return NULL; storesize=(long *)((char *)val); *storesize=size; return ((char *)val+4); } short MemError(void) { return 0; } long GetPtrSize(Ptr mem) { long *storesize; storesize=(long *)((char *)mem-4); return *storesize; } void BlockMove(Ptr mem1, Ptr mem2, long amount) { memmove(mem2,mem1,(unsigned int)amount); }