}
}
-// void os::paging::page_allocator::mark_as_used(block b);
os::paging::page_allocator::block os::paging::page_allocator::allocate(std::uint64_t count) {
for (auto it = begin(); it != end(); it = it->next) {
if (count == it->size) {
return { .ptr = nullptr, .size = 0 };
}
void os::paging::page_allocator::deallocate(block b) {
+ if (b.size == 0) { return; }
const phys_ptr<page> b_it{b.ptr.get_phys_addr()};
auto it = begin();
while (it != end() && it < b_it) { it = it->next; }
page_allocator(phys_ptr<paging::page> one_past_end_page);
void print_all() const;
- void mark_as_used(block b);
block allocate(std::uint64_t page_count);
void deallocate(block b);