kern: randomize dynamic slab heaps to reflect 10.x changes

This commit is contained in:
Michael Scire
2020-04-19 00:35:05 -07:00
parent b4d003b4b9
commit dcfb3bc9b5
4 changed files with 45 additions and 20 deletions

View File

@@ -64,11 +64,12 @@ namespace ams::kern {
this->page_bitmap.Initialize(metadata_ptr, this->count);
/* Free the pages to the bitmap. */
PageBuffer *cur_page = GetPointer<PageBuffer>(this->address);
std::memset(GetPointer<PageBuffer>(this->address), 0, this->count * sizeof(PageBuffer));
for (size_t i = 0; i < this->count; i++) {
std::memset(cur_page, 0, sizeof(*cur_page));
this->page_bitmap.SetBit(i);
}
return ResultSuccess();
}
constexpr KVirtualAddress GetAddress() const { return this->address; }