void cxAutoPoolPush() { cxAutoPool pool = CX_ALLOC(cxAutoPool); cxStack stack = cxAutoPoolStack(); cxStackPush(stack, pool); CX_RELEASE(pool); }
void cxStackReplaceTop(cxStack stack,cxAny any) { cxInt last = cxArrayLength(stack->array) - 1; if(last < 0){ cxStackPush(stack, any); }else{ cxArrayUpdate(stack->array, any, last); } }
void cxStackReplaceTop(cxAny pstack,cxAny any) { CX_ASSERT_THIS(pstack, cxStack); cxInt last = cxArrayLength(this->array) - 1; if(last < 0){ cxStackPush(this, any); }else{ cxArrayUpdate(this->array, any, last); } }
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); }
CX_SETTER_DEF(cxStack, items) { CX_ASSERT(cxJsonIsArray(value), "items must is array"); cxJson items = cxJsonToArray(value); CX_JSON_ARRAY_EACH_BEG(items, v) cxAny any = cxJsonTocxObject(v); if(any != NULL){ cxStackPush(this, any); } CX_JSON_ARRAY_EACH_END(items, v) }
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; }