pub struct Relief {
pub moved: usize,
pub freed: usize,
}Expand description
What a sweep did, which is two numbers because it does two things.
Kept apart rather than added up because they answer different questions.
moved is how much colder the keyspace got and it is what a test about
demotion is written against. freed is how much memory came back, and that
is what a server holding itself to a limit has to read.
Fields§
§moved: usizeValues that went out to the file.
freed: usizeBytes of memory the map gave back while that was happening, which is segments the arena handed over and not records that got shorter.
Implementations§
Source§impl Relief
impl Relief
Sourcepub const fn made_room(self) -> bool
pub const fn made_room(self) -> bool
Whether the sweep is worth calling again, which is the question the caller with the limit is really asking.
Either number being non zero is progress. Both being zero is a keyspace with nothing left to move and no dead space to reclaim, and a write that cannot be fitted in that is a write that has to be refused.