Lines Matching defs:newCapacity
133 * @param newCapacity must be >0
136 inline T *allocateInsteadAndReset(int32_t newCapacity=1);
142 * @param newCapacity must be >0
148 inline T *allocateInsteadAndCopy(int32_t newCapacity=1, int32_t length=0);
159 inline T *LocalMemory<T>::allocateInsteadAndReset(int32_t newCapacity) {
160 if(newCapacity>0) {
161 T *p=(T *)uprv_malloc(newCapacity*sizeof(T));
163 uprv_memset(p, 0, newCapacity*sizeof(T));
175 inline T *LocalMemory<T>::allocateInsteadAndCopy(int32_t newCapacity, int32_t length) {
176 if(newCapacity>0) {
177 T *p=(T *)uprv_malloc(newCapacity*sizeof(T));
180 if(length>newCapacity) {
181 length=newCapacity;
263 * @param newCapacity can be less than or greater than the current capacity;
268 inline T *resize(int32_t newCapacity, int32_t length=0);
313 inline T *MaybeStackArray<T, stackCapacity>::resize(int32_t newCapacity, int32_t length) {
314 if(newCapacity>0) {
315 T *p=(T *)uprv_malloc(newCapacity*sizeof(T));
321 if(length>newCapacity) {
322 length=newCapacity;
328 capacity=newCapacity;
435 * @param newCapacity can be less than or greater than the current capacity;
440 inline H *resize(int32_t newCapacity, int32_t length=0);
482 inline H *MaybeStackHeaderAndArray<H, T, stackCapacity>::resize(int32_t newCapacity,
484 if(newCapacity>=0) {
485 H *p=(H *)uprv_malloc(sizeof(H)+newCapacity*sizeof(T));
493 if(length>newCapacity) {
494 length=newCapacity;
500 capacity=newCapacity;