CommonLibSSE NG
ZeroOverheadHeap.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "RE/B/BSAtomic.h"
4 #include "RE/I/IMemoryHeap.h"
5 
6 namespace RE
7 {
9  {
10  public:
11  inline static constexpr auto RTTI = RTTI_ZeroOverheadHeap;
12 
13  ~ZeroOverheadHeap() override; // 00
14 
15  // override (IMemoryHeap)
16  std::size_t Size(const void* a_block) const override; // 01
17  void GetMemoryStats(MemoryStats* a_stats) override; // 02
18  bool ContainsBlockImpl(const void* a_block) const override; // 03
19  void* AllocateAlignImpl(std::size_t a_size, std::uint32_t a_alignment) override; // 04
20  const char* GetName() const override; // 07 - { return name; }
21  void* Allocate(std::size_t a_size, std::uint32_t a_alignment) override; // 08
22  void Deallocate(void* a_pointer, std::uint32_t) override; // 09 - { return; }
23  bool PointerInHeap(const void* a_pointer) const override; // 0A
24  std::size_t TotalSize(const void* a_pointer) const override; // 0B
25  void GetHeapStats(HeapStats* a_stats, bool a_fullBlockInfo) override; // 0C
26  bool ShouldTrySmallBlockPools(std::size_t a_size, MEM_CONTEXT a_context) override; // 0D - { return 0; }
27  std::uint32_t GetPageSize() const override; // 0E - { return 0; }
28 
29  // members
30  std::size_t memSize; // 08
31  const char* name; // 10
32  void* memoryBase; // 18
33  void* nextFreeMem; // 20
34  std::uint32_t unk28; // 28
35  mutable BSSpinLock unk2C; // 2C
36  std::uint32_t unk34; // 34
37  };
38  static_assert(sizeof(ZeroOverheadHeap) == 0x38);
39 }
Definition: BSAtomic.h:51
Definition: IMemoryHeap.h:31
Definition: ZeroOverheadHeap.h:9
void Deallocate(void *a_pointer, std::uint32_t) override
std::size_t Size(const void *a_block) const override
void * nextFreeMem
Definition: ZeroOverheadHeap.h:33
void GetHeapStats(HeapStats *a_stats, bool a_fullBlockInfo) override
bool ContainsBlockImpl(const void *a_block) const override
void * Allocate(std::size_t a_size, std::uint32_t a_alignment) override
void * AllocateAlignImpl(std::size_t a_size, std::uint32_t a_alignment) override
std::size_t TotalSize(const void *a_pointer) const override
const char * GetName() const override
void * memoryBase
Definition: ZeroOverheadHeap.h:32
~ZeroOverheadHeap() override
void GetMemoryStats(MemoryStats *a_stats) override
static constexpr auto RTTI
Definition: ZeroOverheadHeap.h:11
std::uint32_t GetPageSize() const override
std::uint32_t unk34
Definition: ZeroOverheadHeap.h:36
BSSpinLock unk2C
Definition: ZeroOverheadHeap.h:35
std::size_t memSize
Definition: ZeroOverheadHeap.h:30
std::uint32_t unk28
Definition: ZeroOverheadHeap.h:34
bool PointerInHeap(const void *a_pointer) const override
const char * name
Definition: ZeroOverheadHeap.h:31
bool ShouldTrySmallBlockPools(std::size_t a_size, MEM_CONTEXT a_context) override
Definition: AbsorbEffect.h:6
constexpr REL::VariantID RTTI_ZeroOverheadHeap(690289, 398144, 0x1f5f640)
Definition: IMemoryHeap.h:10
Definition: IMemoryStoreBase.h:6