MCPcopy Create free account
hub / github.com/apache/trafficserver / resize

Method resize

src/iocore/cache/P_CacheArray.h:155–184  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

153
154template <class T>
155void
156CacheArray<T>::resize(int new_size)
157{
158 if (new_size > size) {
159 T *new_data;
160 int i;
161
162 if (new_size > FAST_DATA_SIZE) {
163 new_data = new T[new_size];
164 } else {
165 new_data = fast_data;
166 }
167
168 for (i = 0; i < size; i++) {
169 new_data[i] = data[i];
170 }
171
172 for (; i < new_size; i++) {
173 new_data[i] = *default_val;
174 }
175
176 if (data) {
177 if (data != fast_data) {
178 delete[] data;
179 }
180 }
181 data = new_data;
182 size = new_size;
183 }
184}

Callers 15

body_reader_helperFunction · 0.45
EncodeBase64Function · 0.45
DecodeBase64Function · 0.45
writeMethod · 0.45
swapFunction · 0.45
RegisterMethod · 0.45
decodeMethod · 0.45
loadBufferMethod · 0.45
loadFunction · 0.45
test_bw_format.ccFile · 0.45
IntrusiveHashMapMethod · 0.45
expandMethod · 0.45

Calls

no outgoing calls

Tested by 2

load_fileFunction · 0.36
incFunction · 0.36