Skip to main content

high_water

Function high_water 

Source
pub fn high_water<T>(f: impl FnOnce() -> T) -> T
Expand description

Run f, which is a buffer the database keeps reaching a size it has never been asked for before.

allow with a name on it, and the name is the claim. A ZRANDMEMBER needs somewhere to shuffle and a SUNION needs somewhere to check for duplicates, and both of those are cleared and refilled rather than built and dropped. So the allocation is not per command, it is per high water mark: a database that has answered a union over a million members holds a million member table, and every union after it that is no larger pays the allocator nothing.

The test is whether the same call made twice allocates the second time. That is a unit test rather than an argument, and every site wrapped in this has one. for_the_data is the neighbouring claim, and the difference is that this memory is not holding anything between commands: it is scratch that has grown to fit the largest question asked so far.