From cfc87c023a0e36fa09bd2c82a7bd1a0cb680a65f Mon Sep 17 00:00:00 2001 From: Fredrik Fornwall Date: Wed, 20 Sep 2023 10:53:59 +0200 Subject: [PATCH] Update README.md --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 4150316..1322e2a 100644 --- a/README.md +++ b/README.md @@ -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