#memory-allocator #embedded #buddy #environments #thread-safe #link-list

buddy-alloc

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

6 releases

0.5.1 Apr 26, 2023
0.5.0 Mar 29, 2023
0.4.2 Mar 7, 2023
0.4.1 Nov 14, 2020
0.1.2 Jan 15, 2020

#59 in Memory management

Download history 684/week @ 2024-01-01 1137/week @ 2024-01-08 709/week @ 2024-01-15 654/week @ 2024-01-22 839/week @ 2024-01-29 833/week @ 2024-02-05 902/week @ 2024-02-12 624/week @ 2024-02-19 677/week @ 2024-02-26 722/week @ 2024-03-04 846/week @ 2024-03-11 1125/week @ 2024-03-18 1265/week @ 2024-03-25 1046/week @ 2024-04-01 635/week @ 2024-04-08 925/week @ 2024-04-15

4,043 downloads per month
Used in 32 crates (7 directly)

MIT license

35KB
832 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

~200KB