MCPcopy Create free account
hub / github.com/erans/pgsqlite / should_discard

Method should_discard

src/protocol/buffer_pool.rs:118–122  ·  view source on GitHub ↗
(&self, max_capacity: usize, cleanup_age: Duration)

Source from the content-addressed store, hash-verified

116 }
117
118 fn should_discard(&self, max_capacity: usize, cleanup_age: Duration) -> bool {
119 // Discard if buffer has grown too large or is too old
120 self.buffer.capacity() > max_capacity ||
121 self.last_used.elapsed() > cleanup_age
122 }
123}
124
125/// Thread-safe buffer pool for reusing BytesMut instances

Callers 1

cleanup_old_buffersMethod · 0.80

Calls 1

capacityMethod · 0.80

Tested by

no test coverage detected