Start the kernel ids over on reset.

So that things aren't affected by wrapping over.  Although, maybe we
should handle that better if it causes incorrect behavior...
This commit is contained in:
Unknown W. Brackets 2013-09-17 08:11:51 -07:00
parent 0185825b23
commit d1d9fb5bbf
2 changed files with 6 additions and 4 deletions

View file

@ -424,7 +424,7 @@ u32 sceKernelIcacheClearAll()
KernelObjectPool::KernelObjectPool()
{
memset(occupied, 0, sizeof(bool)*maxCount);
nextID = 16;
nextID = initialNextID;
}
SceUID KernelObjectPool::Create(KernelObject *obj, int rangeBottom, int rangeTop)
@ -470,6 +470,7 @@ void KernelObjectPool::Clear()
occupied[i]=false;
}
memset(pool, 0, sizeof(KernelObject*)*maxCount);
nextID = initialNextID;
}
KernelObject *&KernelObjectPool::operator [](SceUID handle)

View file

@ -427,7 +427,7 @@ public:
~KernelObjectPool() {}
// Allocates a UID within the range and inserts the object into the map.
SceUID Create(KernelObject *obj, int rangeBottom = 16, int rangeTop = 0x7fffffff);
SceUID Create(KernelObject *obj, int rangeBottom = initialNextID, int rangeTop = 0x7fffffff);
void DoState(PointerWrap &p);
static KernelObject *CreateByIDType(int type);
@ -520,8 +520,9 @@ public:
private:
enum {
maxCount=4096,
handleOffset=0x100
maxCount = 4096,
handleOffset = 0x100,
initialNextID = 0x10
};
KernelObject *pool[maxCount];
bool occupied[maxCount];