fix: various fixes

This commit is contained in:
2026-02-22 10:53:30 +01:00
parent e0bfc97f0f
commit 99f231acd2
11 changed files with 50176 additions and 10 deletions
+17
View File
@@ -105,4 +105,21 @@ namespace Memory {
Free((void*)(uint64_t)ptr + (0x1000 * n));
}
}
void PageFrameAllocator::GetStats(Zenith::MemStats* out) {
if (!out) return;
Lock.Acquire();
uint64_t freeBytes = 0;
Page* current = head.next;
while (current != nullptr) {
freeBytes += current->size;
current = current->next;
}
Lock.Release();
out->totalBytes = g_section.size;
out->freeBytes = freeBytes;
out->usedBytes = g_section.size > freeBytes ? g_section.size - freeBytes : 0;
out->pageSize = 0x1000;
}
};