Tier1: update memstack implementation

CMemoryStack::m_unkSize is always initialized to 0x100000 in apex.
This commit is contained in:
Kawe Mazidjatari 2024-01-09 00:58:31 +01:00
parent ae681fc118
commit f5854cccb5

View File

@ -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;