mirror of
https://github.com/hrydgard/ppsspp.git
synced 2024-11-24 14:00:03 +00:00
Vpl: Correct allocation order when splitting block.
More fuzz testing produced cases that were still off. This is simpler.
This commit is contained in:
parent
6310f559f9
commit
916ba4edaf
@ -213,10 +213,6 @@ struct SceKernelVplHeader {
|
||||
do {
|
||||
auto b = prev->next;
|
||||
if (b->sizeInBlocks > allocBlocks) {
|
||||
if (nextFreeBlock_ == b) {
|
||||
nextFreeBlock_ = prev;
|
||||
}
|
||||
prev = b;
|
||||
b = SplitBlock(b, allocBlocks);
|
||||
}
|
||||
|
||||
@ -289,16 +285,13 @@ struct SceKernelVplHeader {
|
||||
void UnlinkFreeBlock(PSPPointer<SceKernelVplBlock> b, PSPPointer<SceKernelVplBlock> prev) {
|
||||
allocatedInBlocks_ += b->sizeInBlocks;
|
||||
prev->next = b->next;
|
||||
if (nextFreeBlock_ == b) {
|
||||
nextFreeBlock_ = prev;
|
||||
}
|
||||
nextFreeBlock_ = prev;
|
||||
b->next = SentinelPtr();
|
||||
}
|
||||
|
||||
PSPPointer<SceKernelVplBlock> SplitBlock(PSPPointer<SceKernelVplBlock> b, u32 allocBlocks) {
|
||||
u32 prev = b->next.ptr;
|
||||
u32 prev = b.ptr;
|
||||
b->sizeInBlocks -= allocBlocks;
|
||||
b->next = b + b->sizeInBlocks;
|
||||
|
||||
b += b->sizeInBlocks;
|
||||
b->sizeInBlocks = allocBlocks;
|
||||
|
Loading…
Reference in New Issue
Block a user