MCPcopy Create free account
hub / github.com/Niko1221/Strata / shrink

Method shrink

engine/src/core/conversation_cache_test.cpp:47–61  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

45
46 size_t idle_bytes() const override { return idle; }
47 size_t shrink(size_t want) override {
48 ++reclaims;
49 saw_staged = cache && cache->size() == expected_size && cache->find(old_serial) &&
50 cache->index_of(new_serial) == expected_size - 1;
51 if (fail_next) {
52 fail_next = false;
53 fail_after = 0;
54 try { released.emplace_back(); }
55 catch (...) { fail_after = -1; throw; }
56 fail_after = -1;
57 }
58 const size_t given = std::min(idle, want);
59 idle -= given;
60 return given;
61 }
62};
63
64void pool_reclaim_allocation_failure() {

Callers

nothing calls this directly

Calls 3

minFunction · 0.50
sizeMethod · 0.45
findMethod · 0.45

Tested by

no test coverage detected