Expand description
A Rust port of the dlmalloc
allocator.
The dlmalloc
allocator is described at
http://g.oswego.edu/dl/html/malloc.html and this Rust crate is a straight
port of the C code for the allocator into Rust. The implementation is
wrapped up in a Dlmalloc
type and has support for Linux, OSX, and Wasm
currently.
The primary purpose of this crate is that it serves as the default memory
allocator for the wasm32-unknown-unknown
target in the standard library.
Support for other platforms is largely untested and unused, but is used when
testing this crate.
Macros§
- dlassert
- Acts like assert using handle_alloc_error if @DL_CHECKS is set, else does nothing.
- dlverbose
- Prints string with args if @DL_VERBOSE is set. What is the out stream defines in @ext module.
- dlverbose_
no_ flush - Prints string with args if @DL_VERBOSE is set. What is the out stream defines in @ext module.
Structs§
- Dlmalloc
- An allocator instance
- Global
Dlmalloc - An instance of a “global allocator” backed by
Dlmalloc
Constants§
- DLMALLOC_
INIT - Constant initializer for
Dlmalloc
structure.
Functions§
- get_
alloced_ ⚠mem_ size - Returns malloced size