Skip to content

tor-memtrack: Low-level layer for memory quota system

Ian Jackson requested to merge Diziet/arti:memory into main

This implements the lower-level API is described in memory-limit.md.

I have tried to break it up a bit, but I'm afraid this MR is both large and full of large pieces.

Given the way it's mostly added code, I have tried to build it up in stages. This means the earlier parts are not always very well motivated until later in the branch. You may find it useful to look also at the final state, especially the longer Rustdocs (eg, the doc comment on mtracker::State).

On the other hand I don't introduce anything and then modify it, so what you see being added is generally in its final form.

The branch has these phases:

  1. Introduce a new tor_error::ErrorKind, since we don't have this kind of failure yet
  2. Bureaucracy, including creating the crate, and moving the relevant parts of memory-limit.md into the crate and tidying the up a bit
  3. Add code, mostly module by module.
  4. Add comprehensive #[test] tests.
  5. Finishing up: a few docs and allows, an example, and an error type for callers.

It should compile and pass cargo test at each stage, although some docs links may be unresolved until the end.

Merge request reports

Loading