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

Method Relocate

Source/Engine/Core/Memory/Allocation.h:166–177  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

164 }
165
166 FORCE_INLINE void Relocate(const int32 capacity, int32 oldCount, int32 newCount)
167 {
168 T* newData = capacity != 0 ? static_cast<T*>(Allocator::Allocate(capacity * sizeof(T))) : nullptr;
169 if (oldCount)
170 {
171 if (newCount > 0)
172 Memory::MoveItems(newData, _data, newCount);
173 Memory::DestructItems(_data, oldCount);
174 }
175 Allocator::Free(_data);
176 _data = newData;
177 }
178
179 FORCE_INLINE void Free()
180 {

Callers 6

SetCapacityMethod · 0.45
EnsureCapacityMethod · 0.45
AddOneMethod · 0.45
RelocateMethod · 0.45
SetCapacityFunction · 0.45
SetCapacityMethod · 0.45

Calls 1

FreeFunction · 0.50

Tested by

no test coverage detected