Skip to content

slab allocator#195

Draft
hexagonal-sun wants to merge 5 commits intomasterfrom
slab-allocator
Draft

slab allocator#195
hexagonal-sun wants to merge 5 commits intomasterfrom
slab-allocator

Conversation

@hexagonal-sun
Copy link
Owner

  • libkernel: memory: reorganise allocators
    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.

  • libkernel: memory: allocs: move FrameList impl into frame
    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.

  • libkernel: memory: PageAllocGetter: return ref to 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.

  • libkernel: memory: slab: slab: new
    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.

  • libkernel: memory: slab: allocator: new
    Add a new slab allocator implementation. The SlabAllocator manages
    lists of slabs for each size class.

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant