CommonLibSSE (powerof3)
NiAllocator.h
Go to the documentation of this file.
1 #pragma once
2 
3 namespace RE
4 {
5  enum class NiMemEventType
6  {
7  kUnknown = 0,
8  kOperNew = 1,
9  kOperNewArray = 2,
10  kOperDelete = 3,
11  kOperDeleteArray = 4,
12  kMalloc = 5,
13  kRealloc = 6,
14  kAlignedMalloc = 7,
15  kAlignedRealloc = 8,
16  kFree = 9,
17  kAlignedFree = 10,
18  kExternalAlloc = 11,
19  kExternalFree = 12
20  };
21 
23  {
24  public:
25  inline static constexpr auto RTTI = RTTI_NiAllocator;
26  inline static constexpr auto VTABLE = VTABLE_NiAllocator;
27 
28  virtual ~NiAllocator(); // 00
29 
30  // add
31  virtual void* Allocate(std::size_t& a_sizeInBytes, std::size_t& a_alignment, NiMemEventType a_eventType, bool a_provideAccurateSizeOnDeallocate, const char* a_file, std::int32_t a_line, const char* a_function) = 0; // 01
32  virtual void Deallocate(void* a_memory, NiMemEventType a_eventType, std::size_t a_sizeInBytes) = 0; // 02
33  virtual void* Reallocate(void* a_memory, size_t& a_sizeInBytes, std::size_t& a_alignment, NiMemEventType a_eventType, bool a_provideAccurateSizeOnDeallocate, std::size_t a_sizeCurrent, const char* a_file, std::int32_t a_line, const char* a_function) = 0; // 03
34  virtual bool TrackAllocate(const void* const a_memory, std::size_t a_sizeInBytes, NiMemEventType a_eventType, const char* a_file, std::int32_t a_line, const char* a_function) = 0; // 04
35  virtual bool TrackDeallocate(const void* const a_memory, NiMemEventType a_eventType) = 0; // 05
36  virtual void Unk_06(void) = 0; // 06
37  virtual void Initialize() = 0; // 07
38  virtual void Shutdown() = 0; // 08
39  virtual bool VerifyAddress(const void* a_memory) = 0; // 09
40  };
41  static_assert(sizeof(NiAllocator) == 0x8);
42 }
Definition: NiAllocator.h:23
virtual void Deallocate(void *a_memory, NiMemEventType a_eventType, std::size_t a_sizeInBytes)=0
virtual void Unk_06(void)=0
virtual void Shutdown()=0
virtual bool TrackDeallocate(const void *const a_memory, NiMemEventType a_eventType)=0
static constexpr auto RTTI
Definition: NiAllocator.h:25
virtual void * Reallocate(void *a_memory, size_t &a_sizeInBytes, std::size_t &a_alignment, NiMemEventType a_eventType, bool a_provideAccurateSizeOnDeallocate, std::size_t a_sizeCurrent, const char *a_file, std::int32_t a_line, const char *a_function)=0
virtual void * Allocate(std::size_t &a_sizeInBytes, std::size_t &a_alignment, NiMemEventType a_eventType, bool a_provideAccurateSizeOnDeallocate, const char *a_file, std::int32_t a_line, const char *a_function)=0
static constexpr auto VTABLE
Definition: NiAllocator.h:26
virtual ~NiAllocator()
virtual void Initialize()=0
virtual bool VerifyAddress(const void *a_memory)=0
virtual bool TrackAllocate(const void *const a_memory, std::size_t a_sizeInBytes, NiMemEventType a_eventType, const char *a_file, std::int32_t a_line, const char *a_function)=0
Definition: AbsorbEffect.h:6
NiMemEventType
Definition: NiAllocator.h:6
constexpr REL::ID RTTI_NiAllocator(static_cast< std::uint64_t >(690322))
constexpr std::array< REL::ID, 1 > VTABLE_NiAllocator
Definition: Offsets_VTABLE.h:12145