(C) 1998 AROS - The Amiga Research OS
#define POOLSIZE 4096 \* Get a MemHeader structure and some private memory *\ mh=(struct MemHeader *) AllocMem(sizeof(struct MemHeader)+POOLSIZE,MEMF_ANY); if(mh!=NULL) { \* Build a private pool *\ mh->mh_First=(struct MemChunk *)(mh+1); mh->mh_First->mc_Next=NULL; mh->mh_First->mc_Bytes=POOLSIZE; mh->mh_Free=POOLSIZE; { \* Use the pool *\ UBYTE *mem1,*mem2; mem1=Allocate(mh,1000); mem2=Allocate(mh,2000); \* Do something with memory... *\ } \* Free everything at once *\ FreeMem(mh,sizeof(struct MemHeader)+POOLSIZE); }
Changed clib to proto