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

Function reclaimable_cache

engine/src/core/conversation_memory.cpp:185–191  ·  view source on GitHub ↗

The reclaimable file cache of one group, from its memory.stat, in the two forms the guard uses (cache_credit_from_stat in the header has the rules). A memory.stat that is missing gives no credit - not an unknown sample.

Source from the content-addressed store, hash-verified

183// (cache_credit_from_stat in the header has the rules). A memory.stat that is missing gives no credit - not an
184// unknown sample.
185CacheCredit reclaimable_cache(const fs::path& dir, uint64_t current, bool v1) {
186 std::ifstream stat(dir / "memory.stat");
187 if (!stat) return {};
188 std::ostringstream text;
189 text << stat.rdbuf();
190 return cache_credit_from_stat(text.str(), current, v1);
191}
192
193// What the cgroup files say: every finite limit with the usage charged against it (and the cache credits of that
194// group), and the usage and credit of the topmost visible group (the root of this namespace - what a container's own

Callers 1

scan_levelsFunction · 0.85

Calls 2

cache_credit_from_statFunction · 0.85
strMethod · 0.45

Tested by

no test coverage detected