Lines Matching refs:initialCapacity
36 UVector32::UVector32(int32_t initialCapacity, UErrorCode &status) :
42 _init(initialCapacity, status);
47 void UVector32::_init(int32_t initialCapacity, UErrorCode &status) {
48 // Fix bogus initialCapacity values; avoid malloc(0)
49 if (initialCapacity < 1) {
50 initialCapacity = DEFAULT_CAPACITY;
52 if (maxCapacity>0 && maxCapacity<initialCapacity) {
53 initialCapacity = maxCapacity;
55 if (initialCapacity > (int32_t)(INT32_MAX / sizeof(int32_t))) {
56 initialCapacity = uprv_min(DEFAULT_CAPACITY, maxCapacity);
58 elements = (int32_t *)uprv_malloc(sizeof(int32_t)*initialCapacity);
62 capacity = initialCapacity;