Skip to content

Commit cb357f9

Browse files
committed
Helpers are needed for no-gil build
1 parent ee95803 commit cb357f9

File tree

1 file changed

+0
-8
lines changed

1 file changed

+0
-8
lines changed

Objects/object.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2939,28 +2939,20 @@ pointer_to_safe_refcount(void *ptr)
29392939
{
29402940
uintptr_t full = (uintptr_t)ptr;
29412941
assert((full & 3) == 0);
2942-
#if defined(Py_GIL_DISABLED)
2943-
return full + 1;
2944-
#else
29452942
uint32_t refcnt = (uint32_t)full;
29462943
if (refcnt >= (uint32_t)_Py_IMMORTAL_MINIMUM_REFCNT) {
29472944
full = full - ((uintptr_t)_Py_IMMORTAL_MINIMUM_REFCNT) + 1;
29482945
}
29492946
return full + 2;
2950-
#endif
29512947
}
29522948

29532949
static void *
29542950
safe_refcount_to_pointer(uintptr_t refcnt)
29552951
{
2956-
#if defined(Py_GIL_DISABLED)
2957-
return (void *)(refcnt - 1);
2958-
#else
29592952
if (refcnt & 1) {
29602953
refcnt += _Py_IMMORTAL_MINIMUM_REFCNT - 1;
29612954
}
29622955
return (void *)(refcnt - 2);
2963-
#endif
29642956
}
29652957

29662958
/* Add op to the gcstate->trash_delete_later list. Called when the current

0 commit comments

Comments
 (0)