All Projects → rcore-os → buddy_system_allocator

rcore-os / buddy_system_allocator

Licence: MIT license
A buddy system allocator in pure Rust.

Programming Languages

rust
11053 projects

Projects that are alternatives of or similar to buddy system allocator

poireau
Poireau: a sampling allocation debugger
Stars: ✭ 76 (+90%)
Mutual labels:  allocator
alloc-cortex-m
A heap allocator for Cortex-M processors
Stars: ✭ 139 (+247.5%)
Mutual labels:  allocator
mulle-allocator
🔄 Flexible C memory allocation scheme
Stars: ✭ 77 (+92.5%)
Mutual labels:  allocator
duma
duma: Detect Unintended Memory Access (D.U.M.A.) - A Red-Zone memory allocator
Stars: ✭ 63 (+57.5%)
Mutual labels:  allocator
metall
Persistent memory allocator for data-centric analytics
Stars: ✭ 46 (+15%)
Mutual labels:  allocator
buddy alloc
A single header buddy memory allocator for C
Stars: ✭ 46 (+15%)
Mutual labels:  allocator
o1heap
Constant-complexity deterministic memory allocator (heap) for hard real-time high-integrity embedded systems
Stars: ✭ 119 (+197.5%)
Mutual labels:  allocator
slabdbg
GDB plug-in that helps exploiting the Linux kernel's SLUB allocator
Stars: ✭ 55 (+37.5%)
Mutual labels:  allocator
MemoryAllocator.KanameShiki
Fast multi-threaded memory allocator
Stars: ✭ 73 (+82.5%)
Mutual labels:  allocator
book
Writing Interpreters in Rust: a Guide
Stars: ✭ 150 (+275%)
Mutual labels:  allocator
MemoryPool
simple memory pool / thread safe / minimized context switching / Memory managed in 4 levels / Requirements(Windows xp~ / Visualstudio 2015)
Stars: ✭ 14 (-65%)
Mutual labels:  allocator
wasm
fast wasm modules
Stars: ✭ 37 (-7.5%)
Mutual labels:  allocator
mimalloc-rust
The Best and Highest-Leveled and Newest bingding for MiMalloc Ever Existed in Rust
Stars: ✭ 30 (-25%)
Mutual labels:  allocator

buddy_system_allocator

Crates.io version docs.rs

An (almost) drop-in replacement for phil-opp/linked-list-allocator. But it uses buddy system instead.

Usage

To use buddy_system_allocator for global allocator:

use buddy_system_allocator::LockedHeap;

#[global_allocator]
static HEAP_ALLOCATOR: LockedHeap = LockedHeap::<32>::empty();

To init the allocator:

unsafe {
    HEAP_ALLOCATOR.lock().init(heap_start, heap_size);
    // or
    HEAP_ALLOCATOR.lock().add_to_heap(heap_start, heap_end);
}

You can also use FrameAllocator and LockedHeapWithRescue, see their documentation for usage.

Features

  • use_spin (default): Provide a LockedHeap type that implements the GlobalAlloc trait by using a spinlock.
  • const_fn (nightly only): Provide const fn version of LockedHeapWithRescue::new.

License

Some code comes from phil-opp's linked-list-allocator.

Licensed under MIT License. Thanks phill-opp's linked-list-allocator for inspirations and interface.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].