Ejemplo n.º 1
0
void cxAutoPoolPush()
{
    cxAutoPool pool = CX_ALLOC(cxAutoPool);
    cxStack stack = cxAutoPoolStack();
    cxStackPush(stack, pool);
    CX_RELEASE(pool);
}
Ejemplo n.º 2
0
void cxStackReplaceTop(cxStack stack,cxAny any)
{
    cxInt last = cxArrayLength(stack->array) - 1;
    if(last < 0){
        cxStackPush(stack, any);
    }else{
        cxArrayUpdate(stack->array, any, last);
    }
}
Ejemplo n.º 3
0
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);
    }
}
Ejemplo n.º 4
0
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);
}
Ejemplo n.º 5
0
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)
}
Ejemplo n.º 6
0
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;
}