5 stable releases

1.0.4 Aug 31, 2019

#395 in Memory management

Download history 10/week @ 2023-10-28 2/week @ 2023-11-11 6/week @ 2023-11-18 17/week @ 2023-11-25 11/week @ 2023-12-02 5/week @ 2023-12-16 10/week @ 2023-12-23 5/week @ 2024-01-06 3/week @ 2024-01-13 7/week @ 2024-01-20 21/week @ 2024-01-27 20/week @ 2024-02-10

51 downloads per month

MIT license

3KB

alleakator

alt=crocodile

alleakator provides a global allocator that leaks memory on purpose.

Motivation

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.

Usage

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.

Implementation

All function calls are forwarded to a parent allocator that you can specify except dealloc, which is just empty.

Contributing

Contributions are welcome.

License

MIT

Trivia

The image shows a crocodile.

No runtime deps