#memory-allocator #embedded #buddy #environments #syscalls #link-list

buddy-alloc

Buddy-alloc is a memory allocator for no-std Rust, used for embedded environments

7 unstable releases

0.6.0 Oct 15, 2024
0.5.1 Apr 26, 2023
0.5.0 Mar 29, 2023
0.4.1 Nov 14, 2020
0.2.0 Jan 27, 2020

#69 in Memory management

Download history 801/week @ 2024-07-22 867/week @ 2024-07-29 842/week @ 2024-08-05 782/week @ 2024-08-12 589/week @ 2024-08-19 1224/week @ 2024-08-26 1424/week @ 2024-09-02 841/week @ 2024-09-09 573/week @ 2024-09-16 1019/week @ 2024-09-23 806/week @ 2024-09-30 984/week @ 2024-10-07 1170/week @ 2024-10-14 762/week @ 2024-10-21 919/week @ 2024-10-28 569/week @ 2024-11-04

3,536 downloads per month
Used in 30 crates (6 directly)

MIT license

37KB
844 lines

Buddy-alloc

Crates.io

Buddy-alloc is a memory allocator for no-std Rust, used for embedded environments.

Usage

Check examples and Rust Doc.

  • This allocator is combined by a link-list based fast allocator and a buddy allocator.
  • No syscalls, we assume the execution environment has no MMU, you need to pre-allocate the memory range for heaps.
  • No threadsafe supports; you need to implement locks on your own.

Why

My original intention is to enable alloc crate for no-std Rust in CKB-VM without introducing LibC. I choose the buddy allocation algorithm since it's simple, stable, and efficient enough. This crate is designed to be used in general environment, it should be able to used in similar embedded environments.

License

MIT

Dependencies

~205KB