Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/madsmtm/linear-malloc
An ultra simple single-threaded linear allocator
https://github.com/madsmtm/linear-malloc
calloc custom-allocator linear-allocator malloc
Last synced: about 1 month ago
JSON representation
An ultra simple single-threaded linear allocator
- Host: GitHub
- URL: https://github.com/madsmtm/linear-malloc
- Owner: madsmtm
- Created: 2022-02-22T00:50:40.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2022-02-22T00:50:54.000Z (over 2 years ago)
- Last Synced: 2024-09-14T09:43:12.746Z (about 2 months ago)
- Topics: calloc, custom-allocator, linear-allocator, malloc
- Language: Rust
- Homepage:
- Size: 1000 Bytes
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# `linear-malloc`
[![Latest version](https://badgen.net/crates/v/linear-malloc)](https://crates.io/crates/linear-malloc)
[![Documentation](https://docs.rs/linear-malloc/badge.svg)](https://docs.rs/linear-malloc/)# DISCLAIMER! This is a quick hack I did to test things. Don't use!
An ultra simple single-threaded linear allocator.
Useful to make the output of applications running under Cachegrind/Callgrind
more stable (since it doesn't try to do the clever optimizations that the
system allocator does).## Usage
Linux:
```sh
cargo build
LD_PRELOAD=./target/debug/liblinear_malloc.so your-binary
```macOS:
```sh
cargo build
DYLD_INSERT_LIBRARIES=./target/debug/liblinear_malloc.dylib DYLD_FORCE_FLAT_NAMESPACE=1 your-binary
```## Acknowledgements
Got some useful info about allocation strategies from [@mtrebi's `memory-allocators`](https://github.com/mtrebi/memory-allocators), and [@ezrosent's "Allocators in Rust"](https://github.com/ezrosent/allocators-rs) was a good source to help set up the basic framework.