Searched refs:new_capacity (Results 1 – 5 of 5) sorted by relevance
73 size_t new_capacity = capacity_; in Resize() local74 while (new_capacity < new_size) { in Resize()75 new_capacity += (new_capacity >> 1) + 16; in Resize()77 Reserve(new_capacity); in Resize()88 void String::Reserve(size_t new_capacity) { in Reserve() argument91 ptr_ = reinterpret_cast<char*>(realloc(old_ptr, new_capacity + 1)); in Reserve()92 ptr_[new_capacity] = '\0'; in Reserve()93 capacity_ = new_capacity; in Reserve()95 if (size_ > new_capacity) in Reserve()96 size_ = new_capacity; in Reserve()
100 size_t new_capacity = buff_capacity_ * 2; in GetNextLine() local102 buff_ = static_cast<char*>(::realloc(old_buff, new_capacity)); in GetNextLine()106 buff_capacity_ = new_capacity; in GetNextLine()
112 void Reserve(size_t new_capacity);186 void Reserve(size_t new_capacity);236 void Vector<T>::Reserve(size_t new_capacity) { in Reserve() argument237 items_ = reinterpret_cast<T*>(realloc(items_, new_capacity * sizeof(T))); in Reserve()238 capacity_ = new_capacity; in Reserve()
107 size_t new_capacity = capacity_; in Resize() local108 while (new_capacity < new_size) in Resize()109 new_capacity += (new_capacity >> 1) + 8; in Resize()111 Reserve(new_capacity); in Resize()117 void String::Reserve(size_t new_capacity) { in Reserve() argument118 str_ = reinterpret_cast<char*>(::realloc(str_, new_capacity + 1)); in Reserve()119 if (new_capacity > capacity_) in Reserve()120 ::memset(str_ + capacity_, '\0', new_capacity - capacity_); in Reserve()121 capacity_ = new_capacity; in Reserve()
187 void Reserve(size_t new_capacity);