bsalloc

Crates.iobsalloc
lib.rsbsalloc
version0.1.0
sourcesrc
created_at2017-09-03 01:34:42.966077
updated_at2017-09-03 01:34:42.966077
descriptionA simple general-purpose allocator used to bootstrap other allocators.
homepage
repositoryhttps://github.com/ezrosent/allocators-rs/tree/master/bsalloc
max_upload_size
id30336
size9,824
Joshua Liebow-Feeser (joshlf)

documentation

https://docs.rs/bsalloc

README

bsalloc: a global, no-std dynamic memory allocator.

This crate implements a very simple global allocator. This is used to service heap allocations for dependencies of the dynamic allocators in the rest of the repo. In other words, this is used to bootstrap the more efficient allocators in this repo without creating a needless dependency on another malloc implementation.

Structure

The allocator is a thin wrapper around mmap. Instead of simply calling mmap and munmap for dynamic allocations directly (this did slow things down in some microbenchmarks), we have two "size classes", each with a fixed-size global cache. These caches have a thread-safe interface that allows a thread to efficiently re-use memory freed by it or another thread. Naturally, allocations that are larger than the largest size class fall back on mmap directly.

Commit count: 0

cargo fmt