#global-allocator #allocator #memory #bump-pointer

nightly bump-allocator

A high performance `#[global_allocator] implementation using the bump-pointer allocation algorithm

3 releases

0.1.2 Jan 22, 2020
0.1.1 Jan 22, 2020
0.1.0 Jan 22, 2020

#707 in Memory management

MIT license

6KB
95 lines

bump-allocator-rs

A high performance #[global_allocator] implementation using the bump-pointer allocation algorithm

Usage

As a rust custom global allocaor:

extern crate bump_allocator;

#[global_allocator]
static GLOBAL: bump_allocator::BumpPointer = bump_allocator::BumpPointer;

fn main() {
    // Heap allocations here...
    let _boxed = Box::new(233);
}

As a malloc() replacement:

cargo build --release
LD_PRELOAD=target/release/libbump_allocator.so your_program
# e.g.
#   LD_PRELOAD=target/release/libbump_allocator.so ls ~

Dependencies

~44KB