Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
fornwall committed Sep 20, 2023
1 parent 55c032d commit cfc87c0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
[![Crates.io](https://img.shields.io/crates/v/allocation-counter.svg)](https://crates.io/crates/allocation-counter)
[![Docs](https://docs.rs/allocation-counter/badge.svg)](https://docs.rs/allocation-counter/)
[![Build](https://github.com/fornwall/allocation-counter/workflows/CI/badge.svg)](https://github.com/fornwall/allocation-counter/actions?query=workflow%3A%22CI%22)


# allocation-counter
Run some Rust code while counting allocations. Can be used to assert that the desired amount of memory allocations is not exceeded in tests.
Rust library to run code while counting allocations. Can be used to assert that the desired amount of memory allocations is not exceeded in tests.

It works by replacing the System allocator with a custom one which increases a thread local counter on each memory allocation before delegating to the normal system allocator.

# Example usage:
# Example
Add as a dependency - since including the trait replaces the global memory allocator, you most likely want it gated behind a feature:

```toml
Expand Down

0 comments on commit cfc87c0

Please sign in to comment.