MCPcopy Create free account
hub / github.com/FlaxEngine/FlaxEngine / EnsureCapacity

Function EnsureCapacity

Source/Engine/Core/Collections/BitArray.h:277–284  ·  view source on GitHub ↗

Ensures the collection has given capacity (or more). The minimum capacity. True if preserve collection data when changing its size, otherwise collection after resize will be empty.

Source from the content-addressed store, hash-verified

275 /// <param name="minCapacity">The minimum capacity.</param>
276 /// <param name="preserveContents">True if preserve collection data when changing its size, otherwise collection after resize will be empty.</param>
277 void EnsureCapacity(const int32 minCapacity, const bool preserveContents = true)
278 {
279 if (_capacity < minCapacity)
280 {
281 const int32 capacity = _allocation.CalculateCapacityGrow(ToItemCapacity(_capacity), minCapacity);
282 SetCapacity(capacity, preserveContents);
283 }
284 }
285
286 /// <summary>
287 /// Sets all items to the given value

Callers 15

ResizeMethod · 0.85
AddTilesMethod · 0.85
AddTileMethod · 0.85
AddMethod · 0.85
AddDefaultMethod · 0.85
ConcurrentBufferClass · 0.85
AddZeroedMethod · 0.85
ResizeFunction · 0.85
AddFunction · 0.85
ResizeMethod · 0.85
OnAddMethod · 0.85
CompactMethod · 0.85

Calls 2

SetCapacityFunction · 0.70
CalculateCapacityGrowMethod · 0.45

Tested by

no test coverage detected