Skip to content

Commit

Permalink
feat(alloc): impl GlobalAlloc for buddy::Alloc (#95)
Browse files Browse the repository at this point in the history
this PR adds an impl of `GlobalAlloc` for `mycelium_alloc::buddy::Alloc`
so that we can reuse the buddy allocator as a heap allocator. no
functional change here.

in order to add this, i refactored the allocation code out of the
`page::Alloc` impl into inherent methods that operate on `Layout`s and
addrs, and reimplemented page allocation on top of that.

since we now operate on `Layout`s internally, we also rely on some of
their additional invariants.

note that i haven't actually tested this, but, like...it probably works?
  • Loading branch information
hawkw authored Jan 26, 2021
1 parent c178c3a commit 45d632d
Showing 1 changed file with 216 additions and 111 deletions.
Loading

0 comments on commit 45d632d

Please sign in to comment.