Home | History | Annotate | Download | only in common

Lines Matching refs:newCapacity

180      * @param newCapacity must be >0
183 inline T *allocateInsteadAndReset(int32_t newCapacity=1);
189 * @param newCapacity must be >0
195 inline T *allocateInsteadAndCopy(int32_t newCapacity=1, int32_t length=0);
206 inline T *LocalMemory<T>::allocateInsteadAndReset(int32_t newCapacity) {
207 if(newCapacity>0) {
208 T *p=(T *)uprv_malloc(newCapacity*sizeof(T));
210 uprv_memset(p, 0, newCapacity*sizeof(T));
222 inline T *LocalMemory<T>::allocateInsteadAndCopy(int32_t newCapacity, int32_t length) {
223 if(newCapacity>0) {
224 T *p=(T *)uprv_malloc(newCapacity*sizeof(T));
227 if(length>newCapacity) {
228 length=newCapacity;
313 * @param newCapacity can be less than or greater than the current capacity;
318 inline T *resize(int32_t newCapacity, int32_t length=0);
363 inline T *MaybeStackArray<T, stackCapacity>::resize(int32_t newCapacity, int32_t length) {
364 if(newCapacity>0) {
366 ::fprintf(::stderr,"MaybeStacArray (resize) alloc %d * %lu\n", newCapacity,sizeof(T));
368 T *p=(T *)uprv_malloc(newCapacity*sizeof(T));
374 if(length>newCapacity) {
375 length=newCapacity;
381 capacity=newCapacity;
491 * @param newCapacity can be less than or greater than the current capacity;
496 inline H *resize(int32_t newCapacity, int32_t length=0);
538 inline H *MaybeStackHeaderAndArray<H, T, stackCapacity>::resize(int32_t newCapacity,
540 if(newCapacity>=0) {
542 ::fprintf(::stderr,"MaybeStackHeaderAndArray alloc %d + %d * %ul\n", sizeof(H),newCapacity,sizeof(T));
544 H *p=(H *)uprv_malloc(sizeof(H)+newCapacity*sizeof(T));
552 if(length>newCapacity) {
553 length=newCapacity;
559 capacity=newCapacity;