Crates.io | alleakator |
lib.rs | alleakator |
version | 1.0.4 |
source | src |
created_at | 2019-08-31 15:01:07.528115 |
updated_at | 2019-08-31 16:28:35.665933 |
description | leaking global allocator |
homepage | |
repository | https://github.com/TimonPasslick/alleakator |
max_upload_size | |
id | 161159 |
size | 3,843 |
alleakator
provides a global allocator that leaks memory on purpose.
If you have a step based program that only runs for a short time, leaking memory is okay - and the fastest computations are the ones that aren't done.
This crate avoids the runtime overhead of freeing memory by just not doing it.
Add this to your main.rs:
use alleakator::Alleakator;
#[global_allocator]
static GLOBAL: Alleakator<YourAllocator> = Alleakator<YourAllocator>;
This works even if you don't use the standard library.
All function calls are forwarded to a parent allocator that you can specify except dealloc
, which is just empty.
Contributions are welcome.
The image shows a crocodile.