MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / validate

Method validate

nodedb-mem/src/governor.rs:109–119  ·  view source on GitHub ↗

Validate that the sum of engine limits does not exceed the global ceiling.

(&self)

Source from the content-addressed store, hash-verified

107impl GovernorConfig {
108 /// Validate that the sum of engine limits does not exceed the global ceiling.
109 pub fn validate(&self) -> Result<()> {
110 let total: usize = self.engine_limits.values().sum();
111 if total > self.global_ceiling {
112 return Err(MemError::GlobalCeilingExceeded {
113 allocated: total,
114 ceiling: self.global_ceiling,
115 requested: 0,
116 });
117 }
118 Ok(())
119 }
120}
121
122/// The central memory governor.

Callers 1

newMethod · 0.45

Calls 1

sumMethod · 0.80

Tested by

no test coverage detected