[kernel] Pull block_allocator out into separate class

The vm_area_guarded code to keep a list of used/free block addresses
will be useful elsewhere.
This commit is contained in:
Justin C. Miller
2022-09-11 14:12:18 -07:00
parent 1d4c66a9a0
commit 7fd39e91c1
3 changed files with 40 additions and 19 deletions

View File

@@ -9,6 +9,7 @@
#include <util/vector.h>
#include <util/enum_bitfields.h>
#include "block_allocator.h"
#include "objects/kobject.h"
class page_tree;
@@ -174,10 +175,8 @@ public:
virtual bool get_page(uintptr_t offset, uintptr_t &phys) override;
private:
util::vector<uintptr_t> m_cache;
uintptr_t m_start;
size_t m_pages;
uintptr_t m_next;
block_allocator m_stacks;
};
} // namespace obj