CX_INLINE cxMemPool cxMemPoolInstance() { cxStack stack = cxMemPoolStack(); if(cxStackLength(stack) == 0){ cxMemPool pool = CX_ALLOC(cxMemPool); cxStackPush(stack, pool); CX_RELEASE(pool); } return cxStackTop(stack); }
static cxAutoPool cxAutoPoolInstance() { cxAutoPool pool = NULL; cxStack stack = cxAutoPoolStack(); if(cxStackLength(stack) == 0){ pool = CX_ALLOC(cxAutoPool); cxStackPush(stack, pool); CX_RELEASE(pool); }else{ pool = cxStackTop(stack); } return pool; }