summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
Diffstat (limited to 'Objects')
-rw-r--r--Objects/codeobject.c4
-rw-r--r--Objects/object.c2
2 files changed, 3 insertions, 3 deletions
diff --git a/Objects/codeobject.c b/Objects/codeobject.c
index 3d804f7..23fc8a7 100644
--- a/Objects/codeobject.c
+++ b/Objects/codeobject.c
@@ -110,7 +110,7 @@ should_intern_string(PyObject *o)
// unless we've disabled immortalizing objects that use deferred reference
// counting.
PyInterpreterState *interp = _PyInterpreterState_GET();
- if (interp->gc.immortalize.enable_on_thread_created) {
+ if (_Py_atomic_load_int(&interp->gc.immortalize) < 0) {
return 1;
}
#endif
@@ -240,7 +240,7 @@ intern_constants(PyObject *tuple, int *modified)
PyThreadState *tstate = PyThreadState_GET();
if (!_Py_IsImmortal(v) && !PyCode_Check(v) &&
!PyUnicode_CheckExact(v) &&
- tstate->interp->gc.immortalize.enable_on_thread_created)
+ _Py_atomic_load_int(&tstate->interp->gc.immortalize) >= 0)
{
PyObject *interned = intern_one_constant(v);
if (interned == NULL) {
diff --git a/Objects/object.c b/Objects/object.c
index a4c6999..ce3df37 100644
--- a/Objects/object.c
+++ b/Objects/object.c
@@ -2433,7 +2433,7 @@ _PyObject_SetDeferredRefcount(PyObject *op)
assert(op->ob_ref_shared == 0);
_PyObject_SET_GC_BITS(op, _PyGC_BITS_DEFERRED);
PyInterpreterState *interp = _PyInterpreterState_GET();
- if (interp->gc.immortalize.enabled) {
+ if (_Py_atomic_load_int_relaxed(&interp->gc.immortalize) == 1) {
// gh-117696: immortalize objects instead of using deferred reference
// counting for now.
_Py_SetImmortal(op);