Make arrangements in tor-memquota for memory tracking to be optional
We want memory tracking to be optional at both compile time and runtime.
One option would be a lot of #[cfg]
and Option
in all the places where we're going to want to plumb this through. That would be quite intrusive.
I think it's best to encode the optionality in tor-memquota
. The technique I have chosen allows runtime conditionality, and compile-time code elimination, without having to duplicate the whole API surface.
The price is a lot of annoying formulaic checking in the the implementation. (At least, the way the types are set up means it's hard to get the checking wrong.)