From f5854cccb53bc215ad9f09dbb3e633a28bd425e5 Mon Sep 17 00:00:00 2001 From: Kawe Mazidjatari <48657826+Mauler125@users.noreply.github.com> Date: Tue, 9 Jan 2024 00:58:31 +0100 Subject: [PATCH] Tier1: update memstack implementation CMemoryStack::m_unkSize is always initialized to 0x100000 in apex. --- r5dev/tier1/memstack.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/r5dev/tier1/memstack.cpp b/r5dev/tier1/memstack.cpp index d4abd3b9..8a885dd9 100644 --- a/r5dev/tier1/memstack.cpp +++ b/r5dev/tier1/memstack.cpp @@ -41,7 +41,6 @@ CMemoryStack::CMemoryStack() , m_pBase( nullptr ) , m_pUnkPtr( nullptr ) , m_bRegisteredAllocation( false ) - , m_unkSize( 0 ) , m_maxSize( 0 ) , m_alignment( 16 ) #ifdef MEMSTACK_VIRTUAL_MEMORY_AVAILABLE @@ -69,11 +68,12 @@ CMemoryStack::~CMemoryStack() //------------------------------------- -bool CMemoryStack::Init( const char *pszAllocOwner, uint64 maxSize, uint64 commitIncrement, uint64 initialCommit, uint64 alignment ) +bool CMemoryStack::Init( const char *pszAllocOwner, size_t maxSize, size_t commitIncrement, size_t initialCommit, size_t alignment ) { Assert( !m_pBase ); m_bPhysical = false; + m_unkSize = 0x100000; // NOTE: always set to this value in this place for R5 (see [r5apex.exe+478B96]). m_maxSize = maxSize; m_alignment = AlignValue( alignment, 4 ); @@ -186,7 +186,7 @@ bool CMemoryStack::Init( const char *pszAllocOwner, uint64 maxSize, uint64 commi //------------------------------------- #ifdef _GAMECONSOLE -bool CMemoryStack::InitPhysical( const char *pszAllocOwner, uint size, uint nBaseAddrAlignment, uint alignment, uint32 nFlags ) +bool CMemoryStack::InitPhysical( const char *pszAllocOwner, size_t size, size_t nBaseAddrAlignment, size_t alignment, uint32 nFlags ) { m_bPhysical = true;