MCPcopy Create free account
hub / github.com/Kitware/VTK / Allocate

Method Allocate

Common/Core/vtkStringArray.cxx:171–193  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

169// Allocate memory for this array. Delete old storage only if necessary.
170
171vtkTypeBool vtkStringArray::Allocate(vtkIdType sz, vtkIdType)
172{
173 if (sz > this->Size)
174 {
175 if (this->DeleteFunction)
176 {
177 this->DeleteFunction(this->Array);
178 }
179
180 this->Size = (sz > 0 ? sz : 1);
181 this->Array = new ValueType[this->Size];
182 if (!this->Array)
183 {
184 return 0;
185 }
186 this->DeleteFunction = DefaultDeleteFunction;
187 }
188
189 this->MaxId = -1;
190 this->DataChanged();
191
192 return 1;
193}
194
195//------------------------------------------------------------------------------
196// Release storage and reset array to initial state.

Callers

nothing calls this directly

Calls 1

DataChangedMethod · 0.95

Tested by

no test coverage detected