Kernel: fork() now copies allocations through FixedWidthAllocator
This commit is contained in:
@@ -15,6 +15,8 @@ namespace Kernel
|
||||
FixedWidthAllocator(MMU&, uint32_t);
|
||||
~FixedWidthAllocator();
|
||||
|
||||
BAN::ErrorOr<FixedWidthAllocator*> clone(MMU&);
|
||||
|
||||
vaddr_t allocate();
|
||||
bool deallocate(vaddr_t);
|
||||
|
||||
@@ -24,6 +26,8 @@ namespace Kernel
|
||||
uint32_t max_allocations() const;
|
||||
|
||||
private:
|
||||
bool allocate_page_if_needed(vaddr_t, uint8_t flags);
|
||||
|
||||
struct node
|
||||
{
|
||||
node* prev { nullptr };
|
||||
@@ -34,6 +38,9 @@ namespace Kernel
|
||||
node* node_from_address(vaddr_t) const;
|
||||
void allocate_page_for_node_if_needed(const node*);
|
||||
|
||||
void allocate_node(node*);
|
||||
void deallocate_node(node*);
|
||||
|
||||
private:
|
||||
static constexpr uint32_t m_min_allocation_size = 16;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user