Skip to content

Commit 04826f7

Browse files
committed
Add comment for maybe_enable_deferred_ref_count().
1 parent 5ef77af commit 04826f7

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Python/specialize.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -360,6 +360,10 @@ static void
360360
maybe_enable_deferred_ref_count(PyObject *op)
361361
{
362362
if (!_Py_IsOwnedByCurrentThread(op)) {
363+
// For module level variables that are heavily used from multiple
364+
// threads, deferred reference counting provides good scaling
365+
// benefits. The downside is that the object will only be deallocated
366+
// by a GC run.
363367
PyUnstable_Object_EnableDeferredRefcount(op);
364368
}
365369
}

0 commit comments

Comments
 (0)