From: Amelia Coutard Date: Thu, 13 Oct 2022 14:45:51 +0000 (+0200) Subject: Made the physical pages returned by the allocator null, to avoid any unexpected bugs... X-Git-Url: https://git.ameliathe1st.gay/?a=commitdiff_plain;h=33df3f31307b920c5b5fbef0a1039d07197ae809;p=voyage-au-centre-des-fichiers.git Made the physical pages returned by the allocator null, to avoid any unexpected bugs. Might change later --- diff --git a/src/paging.cpp b/src/paging.cpp index eeef690..302a675 100644 --- a/src/paging.cpp +++ b/src/paging.cpp @@ -73,12 +73,18 @@ os::paging::page_allocator_t::block os::paging::page_allocator_t::allocate(std:: for (auto it = begin(); it != end(); it = it->next) { if (count == it->size) { erase(it); + for (std::size_t i = 0; i < count * 0x1000; i++) { + phys_ptr(it.get_phys_addr())[i] = 0; + } return { .ptr = phys_ptr(it.get_phys_addr()), .size = count, }; } else if (count < it->size) { erase(split_at_offset(it, count)); + for (std::size_t i = 0; i < count * 0x1000; i++) { + phys_ptr(it.get_phys_addr())[i] = 0; + } return { .ptr = phys_ptr(it.get_phys_addr()), .size = count,