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

Method Allocate

Common/Core/vtkVariantArray.cxx:127–149  ·  view source on GitHub ↗

------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

125
126//------------------------------------------------------------------------------
127vtkTypeBool vtkVariantArray::Allocate(vtkIdType sz, vtkIdType)
128{
129 if (sz > this->Size)
130 {
131 if (this->DeleteFunction)
132 {
133 this->DeleteFunction(this->Array);
134 }
135
136 this->Size = (sz > 0 ? sz : 1);
137 this->Array = new ValueType[this->Size];
138 if (!this->Array)
139 {
140 return 0;
141 }
142 this->DeleteFunction = DefaultDeleteFunction;
143 }
144
145 this->MaxId = -1;
146 this->DataChanged();
147
148 return 1;
149}
150
151//------------------------------------------------------------------------------
152void vtkVariantArray::Initialize()

Callers

nothing calls this directly

Calls 1

DataChangedMethod · 0.95

Tested by

no test coverage detected