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:
@@ -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:
|
||||
|
||||
@@ -57,6 +57,7 @@ namespace Kernel
|
||||
BAN::ErrorOr<void> set_working_directory(BAN::StringView);
|
||||
|
||||
BAN::ErrorOr<void*> allocate(size_t);
|
||||
void free(void*);
|
||||
|
||||
void termid(char*) const;
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
#define SYS_SEEK 6
|
||||
#define SYS_OPEN 7
|
||||
#define SYS_ALLOC 8
|
||||
#define SYS_FREE 9
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user