-changed a few things in mem2 memory management again (hopefully

it doesnt break everything :P)
This commit is contained in:
fix94.1 2012-06-20 11:44:55 +00:00
parent cabfc9b51d
commit 3f79b1f8e0

View File

@ -6,14 +6,12 @@
#include "lockMutex.hpp" #include "lockMutex.hpp"
#define IOS_RELOAD_AREA 0x90200000
void CMEM2Alloc::init(unsigned int size) void CMEM2Alloc::init(unsigned int size)
{ {
m_baseAddress = (SBlock *) std::max(((u32)SYS_GetArena2Lo() + 31) & ~31, IOS_RELOAD_AREA); m_baseAddress = (SBlock *)(((u32)SYS_GetArena2Lo() + 31) & ~31);
m_endAddress = (SBlock *)((char *)m_baseAddress + std::min(size * 0x100000, SYS_GetArena2Size() & ~31)); m_endAddress = (SBlock *)((char *)m_baseAddress + std::min(size * 0x100000, SYS_GetArena2Size() & ~31));
if (m_endAddress > (SBlock *)0x93300000) if (m_endAddress > (SBlock *)0x93100000)
m_endAddress = (SBlock *)0x93300000; m_endAddress = (SBlock *)0x93100000;
SYS_SetArena2Lo(m_endAddress); SYS_SetArena2Lo(m_endAddress);
LWP_MutexInit(&m_mutex, 0); LWP_MutexInit(&m_mutex, 0);
} }