From e675602250888ff1e53c61e7badb5a6c2f721ad5 Mon Sep 17 00:00:00 2001 From: theo3 Date: Thu, 24 Jun 2021 22:22:17 -0700 Subject: [PATCH] MemoryProfiler done --- data/uking_functions.csv | 8 ++++---- src/KingSystem/System/CMakeLists.txt | 2 ++ src/KingSystem/System/MemoryProfiler.cpp | 13 +++++++++++++ src/KingSystem/System/MemoryProfiler.h | 21 +++++++++++++++++++++ 4 files changed, 40 insertions(+), 4 deletions(-) create mode 100644 src/KingSystem/System/MemoryProfiler.cpp create mode 100644 src/KingSystem/System/MemoryProfiler.h diff --git a/data/uking_functions.csv b/data/uking_functions.csv index 374ed3bc..750c65d8 100644 --- a/data/uking_functions.csv +++ b/data/uking_functions.csv @@ -88677,10 +88677,10 @@ 0x00000071010b7b54,sub_71010B7B54,88, 0x00000071010b7bac,sub_71010B7BAC,128, 0x00000071010b7c2c,sub_71010B7C2C,88, -0x00000071010b7c84,sub_71010B7C84,56, -0x00000071010b7cbc,sub_71010B7CBC,92, -0x00000071010b7d18,MemoryProfiler::createInstance,128, -0x00000071010b7d98,MemoryProfiler::init,12, +0x00000071010b7c84,sub_71010B7C84,56,_ZN4ksys14MemoryProfiler18SingletonDisposer_D1Ev +0x00000071010b7cbc,sub_71010B7CBC,92,_ZN4ksys14MemoryProfiler18SingletonDisposer_D0Ev +0x00000071010b7d18,MemoryProfiler::createInstance,128,_ZN4ksys14MemoryProfiler14createInstanceEPN4sead4HeapE +0x00000071010b7d98,MemoryProfiler::init,12,_ZN4ksys14MemoryProfiler4initEPN4sead4HeapE 0x00000071010b7da4,sub_71010B7DA4,100, 0x00000071010b7e08,sub_71010B7E08,108, 0x00000071010b7e74,MessageCapture::createInstance,144, diff --git a/src/KingSystem/System/CMakeLists.txt b/src/KingSystem/System/CMakeLists.txt index d59a029b..eef3d562 100644 --- a/src/KingSystem/System/CMakeLists.txt +++ b/src/KingSystem/System/CMakeLists.txt @@ -12,6 +12,8 @@ target_sources(uking PRIVATE HavokWorkerMgr.h KingEditor.cpp KingEditor.h + MemoryProfiler.cpp + MemoryProfiler.h OcclusionQueryCylinder.cpp OcclusionQueryCylinder.h OverlayArena.cpp diff --git a/src/KingSystem/System/MemoryProfiler.cpp b/src/KingSystem/System/MemoryProfiler.cpp new file mode 100644 index 00000000..18318def --- /dev/null +++ b/src/KingSystem/System/MemoryProfiler.cpp @@ -0,0 +1,13 @@ +#include "KingSystem/System/MemoryProfiler.h" + +namespace ksys { + +SEAD_SINGLETON_DISPOSER_IMPL(MemoryProfiler) + +void MemoryProfiler::init(sead::Heap* heap) { + mHeap = heap; + _28 = nullptr; + _30 = nullptr; +} + +} // namespace ksys diff --git a/src/KingSystem/System/MemoryProfiler.h b/src/KingSystem/System/MemoryProfiler.h new file mode 100644 index 00000000..d38bced4 --- /dev/null +++ b/src/KingSystem/System/MemoryProfiler.h @@ -0,0 +1,21 @@ +#pragma once + +#include +#include "KingSystem/Utils/Types.h" + +namespace ksys { + +class MemoryProfiler { + SEAD_SINGLETON_DISPOSER(MemoryProfiler) + MemoryProfiler() = default; + +public: + void init(sead::Heap* heap); + + sead::Heap* mHeap{}; + void* _28{}; + void* _30{}; +}; +KSYS_CHECK_SIZE_NX150(MemoryProfiler, 0x38); + +} // namespace ksys