feat(pfa): Add PageFrameAllocator class
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
/*
|
||||
* PageFrameAllocator.hpp
|
||||
* Memory allocator for physical pages
|
||||
* Copyright (c) 2025 Daniel Hammer
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#include "Memmap.hpp"
|
||||
|
||||
namespace Memory {
|
||||
class PageFrameAllocator {
|
||||
struct Page {
|
||||
std::size_t size;
|
||||
Page* next;
|
||||
};
|
||||
|
||||
Page head{};
|
||||
|
||||
LargestSection g_section;
|
||||
public:
|
||||
PageFrameAllocator(LargestSection section);
|
||||
|
||||
void* Allocate();
|
||||
void Free(void* ptr);
|
||||
};
|
||||
|
||||
extern PageFrameAllocator* g_pfa;
|
||||
};
|
||||
Reference in New Issue
Block a user