Skip to content

Commit

Permalink
Add READMEs to individual crates
Browse files Browse the repository at this point in the history
Signed-off-by: Nico Burns <nico@nicoburns.com>
  • Loading branch information
nicoburns committed Feb 7, 2025
1 parent aee67ac commit e4d5153
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
23 changes: 23 additions & 0 deletions malloc_size_of/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# MallocSizeOf

[![Build Status](https://github.com/servo/malloc_size_of/actions/workflows/main.yml/badge.svg)](https://github.com/servo/malloc_size_of/actions)
[![Crates.io](https://img.shields.io/crates/v/malloc_size_of.svg)](https://crates.io/crates/malloc_size_of)
[![Docs](https://docs.rs/malloc_size_of/badge.svg)](https://docs.rs/malloc_size_of)
![Crates.io License](https://img.shields.io/crates/l/malloc_size_of)
[![dependency status](https://deps.rs/repo/github/servo/malloc_size_of/status.svg)](https://deps.rs/repo/github/servo/malloc_size_of)

A an allocator-agnostic crate for measuring the runtime size of a value
including the size of any heap allocations that are owned by that value.

This crate is used by both Servo and Firefox for memory usage calculation.

## Features

- It isn't bound to a particular heap allocator.
- It provides traits for both "shallow" and "deep" measurement, which gives
flexibility in the cases where the traits can't be used.
- It allows for measuring blocks even when only an interior pointer can be
obtained for heap allocations, e.g. `HashSet` and `HashMap`. (This relies
on the heap allocator having suitable support, which `jemalloc` has.)
- It allows handling of types like `Rc` and `Arc` by providing traits that
are different to the ones for non-graph structures.
3 changes: 3 additions & 0 deletions malloc_size_of_derive/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# MallocSizeOfDerive

A derive macro for the `MallocSizeOf` trait from the [malloc_size_of](https://crates.io/crates/malloc_size_of) crate.

0 comments on commit e4d5153

Please sign in to comment.