CommonLibVR
Loading...
Searching...
No Matches
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
6namespace RE
7{
9 {
10 public:
11 inline static constexpr auto RTTI = RTTI_ZeroOverheadHeap;
12 inline static constexpr auto VTABLE = VTABLE_ZeroOverheadHeap;
13
14 ~ZeroOverheadHeap() override; // 00
15
16 // override (IMemoryHeap)
17 std::size_t Size(const void* a_block) const override; // 01
18 void GetMemoryStats(MemoryStats* a_stats) override; // 02
19 bool ContainsBlockImpl(const void* a_block) const override; // 03
20 void* AllocateAlignImpl(std::size_t a_size, std::uint32_t a_alignment) override; // 04
21 const char* GetName() const override; // 07 - { return name; }
22 void* Allocate(std::size_t a_size, std::uint32_t a_alignment) override; // 08
23 void Deallocate(void* a_pointer, std::uint32_t) override; // 09 - { return; }
24 bool PointerInHeap(const void* a_pointer) const override; // 0A
25 std::size_t TotalSize(const void* a_pointer) const override; // 0B
26 void GetHeapStats(HeapStats* a_stats, bool a_fullBlockInfo) override; // 0C
27 bool ShouldTrySmallBlockPools(std::size_t a_size, MEM_CONTEXT a_context) override; // 0D - { return 0; }
28 std::uint32_t GetPageSize() const override; // 0E - { return 0; }
29
30 // members
31 std::size_t memSize; // 08
32 const char* name; // 10
33 void* memoryBase; // 18
34 void* nextFreeMem; // 20
35 std::uint32_t unk28; // 28
36 mutable BSSpinLock unk2C; // 2C
37 std::uint32_t unk34; // 34
38 private:
40 };
41 static_assert(sizeof(ZeroOverheadHeap) == 0x38);
42}
#define KEEP_FOR_RE()
Definition PCH.h:517
Definition BSAtomic.h:92
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
static constexpr auto VTABLE
Definition ZeroOverheadHeap.h:12
void * nextFreeMem
Definition ZeroOverheadHeap.h:34
void GetHeapStats(HeapStats *a_stats, bool a_fullBlockInfo) override
bool ContainsBlockImpl(const void *a_block) const override
void * AllocateAlignImpl(std::size_t a_size, std::uint32_t a_alignment) override
std::size_t TotalSize(const void *a_pointer) const override
void * memoryBase
Definition ZeroOverheadHeap.h:33
~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:37
BSSpinLock unk2C
Definition ZeroOverheadHeap.h:36
std::size_t memSize
Definition ZeroOverheadHeap.h:31
std::uint32_t unk28
Definition ZeroOverheadHeap.h:35
bool PointerInHeap(const void *a_pointer) const override
const char * name
Definition ZeroOverheadHeap.h:32
const char * GetName() const override
void * Allocate(std::size_t a_size, std::uint32_t a_alignment) override
bool ShouldTrySmallBlockPools(std::size_t a_size, MEM_CONTEXT a_context) override
Definition AbsorbEffect.h:6
constexpr std::array< REL::ID, 1 > VTABLE_ZeroOverheadHeap
Definition Offsets_VTABLE.h:12984
constexpr REL::ID RTTI_ZeroOverheadHeap(static_cast< std::uint64_t >(690289))
Definition IMemoryHeap.h:10
Definition IMemoryStoreBase.h:6