コード例 #1
0
ファイル: cxAutoPool.c プロジェクト: iloveican/cxEngine
void cxAutoPoolPush()
{
    cxAutoPool pool = CX_ALLOC(cxAutoPool);
    cxStack stack = cxAutoPoolStack();
    cxStackPush(stack, pool);
    CX_RELEASE(pool);
}
コード例 #2
0
ファイル: cxStack.c プロジェクト: KrisLee/cxEngine
void cxStackReplaceTop(cxStack stack,cxAny any)
{
    cxInt last = cxArrayLength(stack->array) - 1;
    if(last < 0){
        cxStackPush(stack, any);
    }else{
        cxArrayUpdate(stack->array, any, last);
    }
}
コード例 #3
0
ファイル: cxStack.c プロジェクト: caoyu0/cxEngine
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);
    }
}
コード例 #4
0
ファイル: cxMemPool.c プロジェクト: caoyu0/cxEngine
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);
}
コード例 #5
0
ファイル: cxStack.c プロジェクト: caoyu0/cxEngine
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)
}
コード例 #6
0
ファイル: cxAutoPool.c プロジェクト: iloveican/cxEngine
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;
}