MCPcopy Create free account
hub / github.com/AtomaAI/atoma-infer / decrease_ref_count

Method decrease_ref_count

backends/vllm/src/block.rs:247–257  ·  view source on GitHub ↗

Decreases the reference count by 1. # Returns - `Ok(())` if the reference count was successfully decreased. - `Err(BlockError::ReferenceCountError)` if the reference count is already zero. # Errors This method will return an error if the reference count is already zero, as it's not possible to decrease it further.

(&mut self)

Source from the content-addressed store, hash-verified

245 /// This method will return an error if the reference count is already zero,
246 /// as it's not possible to decrease it further.
247 pub fn decrease_ref_count(&mut self) -> Result<(), BlockError> {
248 if self.ref_count > 0 {
249 self.ref_count -= 1;
250 Ok(())
251 } else {
252 error!(
253 "Reference counter is already zero, trying to dereference once more which should not be possible.."
254 );
255 Err(BlockError::ReferenceCountError)
256 }
257 }
258}
259
260/// A thread-safe, shared-ownership wrapper for `PhysicalTokenBlock`.

Callers 1

freeMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected