mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-12-01 10:13:43 +01:00
Avoid reusing uids for kernel objects.
This makes logs easier to read: a uid is an X is an X. Usually. Still sequential, and if it runs out, falls back.
This commit is contained in:
1 parent
086fd24edb
commit
0547d291e3
2 files changed
+6
No files matched your search
@@ -368,12 +368,16 @@ u32 sceKernelIcacheClearAll()
|
||||
KernelObjectPool::KernelObjectPool()
|
||||
{
|
||||
memset(occupied, 0, sizeof(bool)*maxCount);
|
||||
nextID = 16;
|
||||
}
|
||||
|
||||
SceUID KernelObjectPool::Create(KernelObject *obj, int rangeBottom, int rangeTop)
|
||||
{
|
||||
if (rangeTop > maxCount)
|
||||
rangeTop = maxCount;
|
||||
if (nextID >= rangeBottom && nextID < rangeTop)
|
||||
rangeBottom = nextID++;
|
||||
|
||||
for (int i = rangeBottom; i < rangeTop; i++)
|
||||
{
|
||||
if (!occupied[i])
|
||||
@@ -462,6 +466,7 @@ void KernelObjectPool::DoState(PointerWrap &p)
|
||||
kernelObjects.Clear();
|
||||
}
|
||||
|
||||
p.Do(nextID);
|
||||
p.DoArray(occupied, maxCount);
|
||||
for (int i = 0; i < maxCount; ++i)
|
||||
{
|
||||
|
||||
@@ -435,6 +435,7 @@ private:
|
||||
};
|
||||
KernelObject *pool[maxCount];
|
||||
bool occupied[maxCount];
|
||||
int nextID;
|
||||
};
|
||||
|
||||
extern KernelObjectPool kernelObjects;
|
||||
|
||||
Reference in new issue
Block a user