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

Function MoveToEmpty

Source/Engine/Core/Memory/AllocationUtils.h:12–23  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10 // Moves the data from the source allocation to the destination allocation.
11 template<typename T, typename AllocationType>
12 inline void MoveToEmpty(typename AllocationType::template Data<T>& to, typename AllocationType::template Data<T>& from, const int32 fromCount, const int32 fromCapacity)
13 {
14 if IF_CONSTEXPR (AllocationType::HasSwap)
15 to.Swap(from);
16 else
17 {
18 to.Allocate(fromCapacity);
19 Memory::MoveItems(to.Get(), from.Get(), fromCount);
20 Memory::DestructItems(from.Get(), fromCount);
21 from.Free();
22 }
23 }
24}

Callers 4

HashSetFunction · 0.85
HashSet.hFile · 0.85
DictionaryFunction · 0.85
Dictionary.hFile · 0.85

Calls 4

SwapMethod · 0.45
AllocateMethod · 0.45
GetMethod · 0.45
FreeMethod · 0.45

Tested by

no test coverage detected