LeviLamina
Loading...
Searching...
No Matches
IMemoryAllocator.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5namespace Bedrock::Memory {
6
8public:
9 // virtual functions
10 // NOLINTBEGIN
11 virtual ~IMemoryAllocator() = default;
12
13 virtual void* _allocate(uint64 size) = 0;
14
15 virtual void _release(::gsl::not_null<void*> ptr) = 0;
16
17 virtual void* _alignedAllocate(uint64 size, uint64 alignment) = 0;
18
19 virtual void _alignedRelease(::gsl::not_null<void*> ptr) = 0;
20
21 virtual uint64 _getUsableSize(::gsl::not_null<void*> ptr, bool alignedAllocation) = 0;
22
23#ifdef LL_PLAT_S
24 virtual void* _realloc(::gsl::not_null<void*> p, uint64 newSize) = 0;
25#else // LL_PLAT_C
26 virtual void* _realloc(::gsl::not_null<void*> ptr, uint64 newSize) = 0;
27#endif
28
29#ifdef LL_PLAT_S
30 virtual void* _alignedRealloc(::gsl::not_null<void*> p, uint64 newSize, uint64 alignment) = 0;
31#else // LL_PLAT_C
32 virtual void* _alignedRealloc(::gsl::not_null<void*> ptr, uint64 newSize, uint64 alignment) = 0;
33#endif
34
35 // NOLINTEND
36
37public:
38 // member functions
39 // NOLINTBEGIN
40 MCAPI void* allocate(uint64 size);
41 // NOLINTEND
42};
43
44} // namespace Bedrock::Memory
Definition IMemoryAllocator.h:7