mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2025-05-16 16:14:25 -04:00
kern: implement dynamic slab init + ini relocation
This commit is contained in:
parent
d9e6771e63
commit
cb6af379d8
20 changed files with 851 additions and 22 deletions
|
@ -55,8 +55,8 @@ namespace ams::kern {
|
|||
const size_t needed_size = this->blocks[index].GetSize();
|
||||
|
||||
for (s32 i = index; i < static_cast<s32>(this->num_blocks); i++) {
|
||||
if (const KVirtualAddress addr = this->blocks[index].PopBlock(); addr != Null<KVirtualAddress>) {
|
||||
if (const size_t allocated_size = this->blocks[index].GetSize(); allocated_size > needed_size) {
|
||||
if (const KVirtualAddress addr = this->blocks[i].PopBlock(); addr != Null<KVirtualAddress>) {
|
||||
if (const size_t allocated_size = this->blocks[i].GetSize(); allocated_size > needed_size) {
|
||||
this->Free(addr + needed_size, (allocated_size - needed_size) / PageSize);
|
||||
}
|
||||
return addr;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue