Draft
Conversation
Create a new submodule within `memory`, `allocators` which contains all memory allocators. Also split out the `Frame` struct from the `pg_alloc` module, allowing it to be used by other modules.
Move the FrameList logic out of the physical memory allocator into its own module. This allows `FrameList` to be shared between the physical memory allocator and the slab allocator.
Rather than returning a reference to the `OnceCell` wrapping the allocator, return a static reference to the allocator itself. This allows flexibility for how the allocator is wrapped.
Add a new module for managing objects within a slab. The `Slab` struct manages objects of a given set within a contiguous set of pages. It is the handle to the underlying memory, allowing for objects to be allocated, and free'd. It manages a free list of 'indexes' within the object slots themselves.
Add a new slab allocator implementation. The `SlabAllocator` manages lists of slabs for each size class.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
libkernel: memory: reorganise allocators
Create a new submodule within
memory,allocatorswhich contains allmemory allocators. Also split out the
Framestruct from thepg_allocmodule, allowing it to be used by other modules.
libkernel: memory: allocs: move FrameList impl into
frameMove the FrameList logic out of the physical memory allocator into its
own module. This allows
FrameListto be shared between the physicalmemory allocator and the slab allocator.
libkernel: memory: PageAllocGetter: return ref to allocator
Rather than returning a reference to the
OnceCellwrapping theallocator, return a static reference to the allocator itself. This
allows flexibility for how the allocator is wrapped.
libkernel: memory: slab: slab: new
Add a new module for managing objects within a slab. The
Slabstructmanages objects of a given set within a contiguous set of pages. It is
the handle to the underlying memory, allowing for objects to be
allocated, and free'd. It manages a free list of 'indexes' within the
object slots themselves.
libkernel: memory: slab: allocator: new
Add a new slab allocator implementation. The
SlabAllocatormanageslists of slabs for each size class.