mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-12-05 20:24:01 +01:00
Don't align size to grain for PMB.
This commit is contained in:
1 parent
20bb472b66
commit
f2bdea74be
3 files changed
+7
-5
No files matched your search
@@ -427,7 +427,7 @@ public:
|
||||
address = alloc->AllocAt(alignment, size, name);
|
||||
}
|
||||
else if (type == PSP_SMEM_LowAligned || type == PSP_SMEM_HighAligned)
|
||||
address = alloc->AllocAligned(size, alignment, type == PSP_SMEM_HighAligned, name);
|
||||
address = alloc->AllocAligned(size, 0x100, alignment, type == PSP_SMEM_HighAligned, name);
|
||||
else
|
||||
address = alloc->Alloc(size, type == PSP_SMEM_High, name);
|
||||
alloc->ListBlocks();
|
||||
|
||||
@@ -45,7 +45,7 @@ void BlockAllocator::Shutdown()
|
||||
blocks.clear();
|
||||
}
|
||||
|
||||
u32 BlockAllocator::AllocAligned(u32 &size, u32 grain, bool fromTop, const char *tag)
|
||||
u32 BlockAllocator::AllocAligned(u32 &size, u32 sizeGrain, u32 grain, bool fromTop, const char *tag)
|
||||
{
|
||||
// Sanity check
|
||||
if (size == 0 || size > rangeSize_) {
|
||||
@@ -56,9 +56,11 @@ u32 BlockAllocator::AllocAligned(u32 &size, u32 grain, bool fromTop, const char
|
||||
// It could be off step, but the grain should generally be a power of 2.
|
||||
if (grain < grain_)
|
||||
grain = grain_;
|
||||
if (sizeGrain < grain_)
|
||||
sizeGrain = grain_;
|
||||
|
||||
// upalign size to grain
|
||||
size = (size + grain - 1) & ~(grain - 1);
|
||||
size = (size + sizeGrain - 1) & ~(sizeGrain - 1);
|
||||
|
||||
if (!fromTop)
|
||||
{
|
||||
@@ -128,7 +130,7 @@ u32 BlockAllocator::AllocAligned(u32 &size, u32 grain, bool fromTop, const char
|
||||
u32 BlockAllocator::Alloc(u32 &size, bool fromTop, const char *tag)
|
||||
{
|
||||
// We want to make sure it's aligned in case AllocAt() was used.
|
||||
return AllocAligned(size, grain_, fromTop, tag);
|
||||
return AllocAligned(size, grain_, grain_, fromTop, tag);
|
||||
}
|
||||
|
||||
u32 BlockAllocator::AllocAt(u32 position, u32 size, const char *tag)
|
||||
|
||||
@@ -40,7 +40,7 @@ public:
|
||||
|
||||
// WARNING: size can be modified upwards!
|
||||
u32 Alloc(u32 &size, bool fromTop = false, const char *tag = 0);
|
||||
u32 AllocAligned(u32 &size, u32 grain, bool fromTop = false, const char *tag = 0);
|
||||
u32 AllocAligned(u32 &size, u32 sizeGrain, u32 grain, bool fromTop = false, const char *tag = 0);
|
||||
u32 AllocAt(u32 position, u32 size, const char *tag = 0);
|
||||
|
||||
bool Free(u32 position);
|
||||
|
||||
Reference in new issue
Block a user