mirror of
https://github.com/python/cpython.git
synced 2025-08-03 08:34:29 +00:00
bpo-40514: Drop EXPERIMENTAL_ISOLATED_SUBINTERPRETERS (gh-93185)
This was added for bpo-40514 (gh-84694) to test out a per-interpreter GIL. However, it has since proven unnecessary to keep the experiment in the repo. (It can be done as a branch in a fork like normal.) So here we are removing: * the configure option * the macro * the code enabled by the macro
This commit is contained in:
parent
e6a57678ca
commit
caa279d6fd
18 changed files with 9 additions and 233 deletions
|
@ -54,11 +54,6 @@ typedef struct PySlot_Offset {
|
|||
} PySlot_Offset;
|
||||
|
||||
|
||||
/* bpo-40521: Interned strings are shared by all subinterpreters */
|
||||
#ifndef EXPERIMENTAL_ISOLATED_SUBINTERPRETERS
|
||||
# define INTERN_NAME_STRINGS
|
||||
#endif
|
||||
|
||||
static PyObject *
|
||||
slot_tp_new(PyTypeObject *type, PyObject *args, PyObject *kwds);
|
||||
|
||||
|
@ -4027,7 +4022,7 @@ type_setattro(PyTypeObject *type, PyObject *name, PyObject *value)
|
|||
if (name == NULL)
|
||||
return -1;
|
||||
}
|
||||
#ifdef INTERN_NAME_STRINGS
|
||||
/* bpo-40521: Interned strings are shared by all subinterpreters */
|
||||
if (!PyUnicode_CHECK_INTERNED(name)) {
|
||||
PyUnicode_InternInPlace(&name);
|
||||
if (!PyUnicode_CHECK_INTERNED(name)) {
|
||||
|
@ -4037,7 +4032,6 @@ type_setattro(PyTypeObject *type, PyObject *name, PyObject *value)
|
|||
return -1;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
else {
|
||||
/* Will fail in _PyObject_GenericSetAttrWithDict. */
|
||||
|
@ -8474,17 +8468,11 @@ _PyTypes_InitSlotDefs(void)
|
|||
for (slotdef *p = slotdefs; p->name; p++) {
|
||||
/* Slots must be ordered by their offset in the PyHeapTypeObject. */
|
||||
assert(!p[1].name || p->offset <= p[1].offset);
|
||||
#ifdef INTERN_NAME_STRINGS
|
||||
/* bpo-40521: Interned strings are shared by all subinterpreters */
|
||||
p->name_strobj = PyUnicode_InternFromString(p->name);
|
||||
if (!p->name_strobj || !PyUnicode_CHECK_INTERNED(p->name_strobj)) {
|
||||
return _PyStatus_NO_MEMORY();
|
||||
}
|
||||
#else
|
||||
p->name_strobj = PyUnicode_FromString(p->name);
|
||||
if (!p->name_strobj) {
|
||||
return _PyStatus_NO_MEMORY();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
slotdefs_initialized = 1;
|
||||
return _PyStatus_OK();
|
||||
|
@ -8509,24 +8497,17 @@ update_slot(PyTypeObject *type, PyObject *name)
|
|||
int offset;
|
||||
|
||||
assert(PyUnicode_CheckExact(name));
|
||||
#ifdef INTERN_NAME_STRINGS
|
||||
assert(PyUnicode_CHECK_INTERNED(name));
|
||||
#endif
|
||||
|
||||
assert(slotdefs_initialized);
|
||||
pp = ptrs;
|
||||
for (p = slotdefs; p->name; p++) {
|
||||
assert(PyUnicode_CheckExact(p->name_strobj));
|
||||
assert(PyUnicode_CheckExact(name));
|
||||
#ifdef INTERN_NAME_STRINGS
|
||||
/* bpo-40521: Using interned strings. */
|
||||
if (p->name_strobj == name) {
|
||||
*pp++ = p;
|
||||
}
|
||||
#else
|
||||
if (p->name_strobj == name || _PyUnicode_EQ(p->name_strobj, name)) {
|
||||
*pp++ = p;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
*pp = NULL;
|
||||
for (pp = ptrs; *pp; pp++) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue