3 releases
0.0.3 | May 14, 2019 |
---|---|
0.0.2 | May 13, 2019 |
0.0.1 | May 13, 2019 |
#13 in #buddy
9KB
78 lines
Buddies: A low-level buddy allocator
Buddies provides a low-level and unsafe buddy allocator to work with - however, making it safe is quite simple. All that needs to be done is to store extra information that does the following things:
- Ensures that all allocations have shorter lifetimes than the allocator
- Ensures that multiple mutable allocations are possible simultaneously
- Ensures that allocations are dropped correctly.
The primitives are provided to do this - see
Buddies::allocate
andBuddies::free
.
It does not require std
, and will remain like this (so that bare-metal
kernels and applications can use it easily).
lib.rs
:
Buddies
: A buddies allocator.
This can be used to allocate blocks of different sizes from a single fixed-width block, and is useful in bare-metal physical memory allocation (which is how Linux does things).
Dependencies
~1MB
~23K SLoC