Lines Matching refs:newCapacity
214 inline T *allocateInsteadAndReset(int32_t newCapacity=1);
226 inline T *allocateInsteadAndCopy(int32_t newCapacity=1, int32_t length=0);
237 inline T *LocalMemory<T>::allocateInsteadAndReset(int32_t newCapacity) { in allocateInsteadAndReset() argument
238 if(newCapacity>0) { in allocateInsteadAndReset()
239 T *p=(T *)uprv_malloc(newCapacity*sizeof(T)); in allocateInsteadAndReset()
241 uprv_memset(p, 0, newCapacity*sizeof(T)); in allocateInsteadAndReset()
253 inline T *LocalMemory<T>::allocateInsteadAndCopy(int32_t newCapacity, int32_t length) { in allocateInsteadAndCopy() argument
254 if(newCapacity>0) { in allocateInsteadAndCopy()
255 T *p=(T *)uprv_malloc(newCapacity*sizeof(T)); in allocateInsteadAndCopy()
258 if(length>newCapacity) { in allocateInsteadAndCopy()
259 length=newCapacity; in allocateInsteadAndCopy()
299 MaybeStackArray(int32_t newCapacity) : MaybeStackArray() { in MaybeStackArray() argument
300 if (capacity < newCapacity) { resize(newCapacity); } in MaybeStackArray()
369 inline T *resize(int32_t newCapacity, int32_t length=0);
447 inline T *MaybeStackArray<T, stackCapacity>::resize(int32_t newCapacity, int32_t length) { in resize() argument
448 if(newCapacity>0) { in resize()
450 ::fprintf(::stderr,"MaybeStacArray (resize) alloc %d * %lu\n", newCapacity,sizeof(T)); in resize()
452 T *p=(T *)uprv_malloc(newCapacity*sizeof(T)); in resize()
458 if(length>newCapacity) { in resize()
459 length=newCapacity; in resize()
465 capacity=newCapacity; in resize()
578 inline H *resize(int32_t newCapacity, int32_t length=0);
620 inline H *MaybeStackHeaderAndArray<H, T, stackCapacity>::resize(int32_t newCapacity, in resize() argument
622 if(newCapacity>=0) { in resize()
624 …::fprintf(::stderr,"MaybeStackHeaderAndArray alloc %d + %d * %ul\n", sizeof(H),newCapacity,sizeof(… in resize()
626 H *p=(H *)uprv_malloc(sizeof(H)+newCapacity*sizeof(T)); in resize()
634 if(length>newCapacity) { in resize()
635 length=newCapacity; in resize()
641 capacity=newCapacity; in resize()