Crates.io | emma |
lib.rs | emma |
version | 0.0.1 |
source | src |
created_at | 2024-08-10 22:41:05.979881 |
updated_at | 2024-08-12 01:14:28.543965 |
description | A full-fledged `no_std` and "no-libc" capable memory allocator. |
homepage | |
repository | https://github.com/danielschemmel/emma/ |
max_upload_size | |
id | 1332774 |
size | 121,816 |
Emma is an EMbeddable Memory Allocator. This means:
no_std
compatible.libc
: emma uses raw syscalls instead. Note that your rustc target may depend on libc
- use the x86_64-unknown-linux-unknown
target, with which emma is compatible, if you want to avoid this.brk
/sbrk
to modify the shared data segment, emma only ever maps its own segments using mmap
.Multiple emma instances can coexist with other allocators the same process. If its symbols are renamed, emma can even coexist with other copies and/or versions of itself without interference!
Use emma as you would any other allocator:
#[global_allocator]
static EMMA: emma::DefaultEmma = emma::DefaultEmma::new();
Emma seems not far behind (other) state-of-the-art allocators.
At the moment, emma exclusively targets linux on x86_64
.
execve
anyway.)fork
(or performing an equivalent clone
call) is safe as long as no thread is currently de-/allocating memory. However, if the forking process ever allocated memory on more than one thread, memory usage will be suboptimal until the new main thread terminates.malloc
or free
as async-signal safe either.)tls
enabling thread-local-storage requires a nightly compiler. Enabling tls
massively increases performance.boundary-checks
enables assertions at the library boundary. These assertions cost a small amount of performance.Licensed under either of:
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.