Kernel/LibC: add free function for FixedWidthAllocator

I have to rework the syscall API and allocators in process. For
now this works well enough :)
This commit is contained in:
Bananymous
2023-05-07 01:21:50 +03:00
parent 890aa9aa15
commit 12e42f40c5
9 changed files with 112 additions and 45 deletions

View File

@@ -17,7 +17,7 @@ namespace Kernel
~FixedWidthAllocator();
vaddr_t allocate();
void deallocate(vaddr_t);
bool deallocate(vaddr_t);
uint32_t allocation_size() const { return m_allocation_size; }
@@ -26,8 +26,10 @@ namespace Kernel
{
node* prev { nullptr };
node* next { nullptr };
bool allocated { false };
};
vaddr_t address_of(const node*) const;
vaddr_t address_of_node(const node*) const;
node* node_from_address(vaddr_t) const;
void allocate_page_for_node_if_needed(const node*);
private: