CommonLibVR
BSNiAllocator.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "RE/N/NiAllocator.h"
4 
5 namespace RE
6 {
7  class BSNiAllocator : public NiAllocator
8  {
9  public:
10  inline static constexpr auto RTTI = RTTI_BSNiAllocator;
11  inline static constexpr auto VTABLE = VTABLE_BSNiAllocator;
12 
13  ~BSNiAllocator() override; // 00
14 
15  // override (
16  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) override; // 01
17  void Deallocate(void* a_memory, NiMemEventType a_eventType, std::size_t a_sizeInBytes) override; // 02
18  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) override; // 03
19  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) override; // 04
20  bool TrackDeallocate(const void* const a_memory, NiMemEventType a_eventType) override; // 05
21  void Unk_06(void) override; // 06 - implements a realloc
22  void Initialize() override; // 07 - { return; }
23  void Shutdown() override; // 08 - { return; }
24  bool VerifyAddress(const void* a_memory) override; // 09 - { return true; }
25  private:
26  KEEP_FOR_RE()
27  };
28  static_assert(sizeof(BSNiAllocator) == 0x8);
29 }
#define KEEP_FOR_RE()
Definition: PCH.h:713
Definition: BSNiAllocator.h:8
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) override
~BSNiAllocator() override
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) override
static constexpr auto RTTI
Definition: BSNiAllocator.h:10
void Unk_06(void) override
void Deallocate(void *a_memory, NiMemEventType a_eventType, std::size_t a_sizeInBytes) override
bool VerifyAddress(const void *a_memory) override
void Shutdown() override
bool TrackDeallocate(const void *const a_memory, NiMemEventType a_eventType) override
void Initialize() override
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) override
static constexpr auto VTABLE
Definition: BSNiAllocator.h:11
Definition: NiAllocator.h:23
Definition: AbsorbEffect.h:6
NiMemEventType
Definition: NiAllocator.h:6
constexpr std::array< REL::ID, 1 > VTABLE_BSNiAllocator
Definition: Offsets_VTABLE.h:9275
constexpr REL::ID RTTI_BSNiAllocator(static_cast< std::uint64_t >(690323))