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

Method SetCapacity

Source/Engine/Core/Collections/Sorting.cpp:27–45  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

25}
26
27void Sorting::SortingStack::SetCapacity(const int32 capacity)
28{
29 ASSERT(capacity >= 0);
30 if (capacity == Capacity)
31 return;
32 int32* newData = nullptr;
33 if (capacity > 0)
34 newData = (int32*)Allocator::Allocate(capacity * sizeof(int32));
35 const int32 newCount = Count < capacity ? Count : capacity;
36 if (Data)
37 {
38 if (newData && newCount)
39 Platform::MemoryCopy(newData, Data, newCount * sizeof(int32));
40 Allocator::Free(Data);
41 }
42 Data = newData;
43 Capacity = capacity;
44 Count = newCount;
45}
46
47void Sorting::SortingStack::EnsureCapacity(int32 minCapacity)
48{

Callers 15

DisposeMethod · 0.45
unloadMethod · 0.45
WriteAllTextMethod · 0.45
OnReleaseGPUMethod · 0.45
DestroyMethod · 0.45
LoadMethod · 0.45
DisposeMethod · 0.45
LoadMethod · 0.45
SetCapacityFunction · 0.45
AddMethod · 0.45
ChunkedArrayClass · 0.45
EnsureCapacityMethod · 0.45

Calls 1

FreeFunction · 0.50

Tested by

no test coverage detected