size_t GetMemoryTotalSize() { if( g_Mutex < 0 ) InitAlloc(); return g_TotalMemory; }
AllocPool::AllocPool(NewAreaFunc inAllocArea, FreeAreaFunc inFreeArea, size_t inAreaInitSize, size_t inAreaMoreSize) { InitBins(); mAreaInitSize = inAreaInitSize; mAreaMoreSize = inAreaMoreSize; mAllocArea = inAllocArea; mFreeArea = inFreeArea; mAreas = 0; check_pool(); InitAlloc(); }
static void LockAlloc() { if( g_Mutex < 0 ) InitAlloc(); SceUID thid = sceKernelGetThreadId(); if( thid != g_MutexOwner ) { sceKernelWaitSema( g_Mutex, 1, NULL ); g_MutexOwner = thid; } else { g_MutexCount++; } }
void AllocPool::Reinit() { FreeAll(); InitAlloc(); }