From 57500d9b090ae5249bb69943f22ceb22a03e1dea Mon Sep 17 00:00:00 2001 From: Alex Gaynor Date: Sat, 11 May 2024 12:48:38 -0400 Subject: [PATCH] Updates comments regarding the reference pool that were inaccurate (#4176) --- src/gil.rs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/gil.rs b/src/gil.rs index d4b92a4c..db8311ab 100644 --- a/src/gil.rs +++ b/src/gil.rs @@ -236,7 +236,7 @@ impl Drop for GILGuard { type PyObjVec = Vec>; #[cfg(not(pyo3_disable_reference_pool))] -/// Thread-safe storage for objects which were inc_ref / dec_ref while the GIL was not held. +/// Thread-safe storage for objects which were dec_ref while the GIL was not held. struct ReferencePool { pending_decrefs: sync::Mutex, } @@ -422,11 +422,8 @@ impl Drop for GILPool { } } -/// Registers a Python object pointer inside the release pool, to have its reference count increased -/// the next time the GIL is acquired in pyo3. -/// -/// If the GIL is held, the reference count will be increased immediately instead of being queued -/// for later. +/// Increments the reference count of a Python object if the GIL is held. If +/// the GIL is not held, this function will panic. /// /// # Safety /// The object must be an owned Python reference.