void ccArrayEnsureExtraCapacity(ccArray *arr, unsigned int extra) { while (arr->max < arr->num + extra) { ccArrayDoubleCapacity(arr); } }
void ccArrayEnsureExtraCapacity(ccArray *arr, ssize_t extra) { while (arr->max < arr->num + extra) { CCLOGINFO("cocos2d: ccCArray: resizing ccArray capacity from [%d] to [%d].", static_cast<int>(arr->max), static_cast<int>(arr->max*2)); ccArrayDoubleCapacity(arr); } }
void CCActionManager::actionAllocWithHashElement(tHashElement *pElement) { // 4 actions per Node by default if (pElement->actions == NULL) { pElement->actions = ccArrayNew(4); } else if (pElement->actions->num == pElement->actions->max) { ccArrayDoubleCapacity(pElement->actions); } }
void ActionManager::actionAllocWithHashElement(tHashElement *element) { // 4 actions per Node by default if (element->actions == nullptr) { element->actions = ccArrayNew(4); }else if (element->actions->num == element->actions->max) { ccArrayDoubleCapacity(element->actions); } }
/** Doubles C array capacity */ void ccCArrayDoubleCapacity(ccCArray *arr) { ccArrayDoubleCapacity((ccArray*)arr); }