aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside6/libpyside/feature_select.cpp
diff options
context:
space:
mode:
authorChristian Tismer <tismer@stackless.com>2022-11-29 15:03:16 +0100
committerChristian Tismer <tismer@stackless.com>2022-11-29 17:57:32 +0100
commit47a9622599822d5db2dd20f13f369c671c4c4fca (patch)
tree8ea86669a14f7d51dd5568c9c84c032e1a7fcb36 /sources/pyside6/libpyside/feature_select.cpp
parent7377d2b8130ce7290775cd8a343e75c0561fc854 (diff)
__feature__: Remove the no longer efficient reserved_bits structure
The reserved_bits structure is no longer an optimization after moving to PyPy. Accessing any extra field involves always a dict lookup. - remove the reserved_bits field - re-order SbkObjectTypePrivate - replace access functions by currentSelectId() Task-number: PSYIDE-2029 Change-Id: I08642eace9a6399649c039bcc358ce678bbd4fd3 Pick-to: 6.4 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'sources/pyside6/libpyside/feature_select.cpp')
-rw-r--r--sources/pyside6/libpyside/feature_select.cpp15
1 files changed, 0 insertions, 15 deletions
diff --git a/sources/pyside6/libpyside/feature_select.cpp b/sources/pyside6/libpyside/feature_select.cpp
index 17c6169af..695a0e61e 100644
--- a/sources/pyside6/libpyside/feature_select.cpp
+++ b/sources/pyside6/libpyside/feature_select.cpp
@@ -153,16 +153,6 @@ static inline PyObject *getSelectId(PyObject *dict)
return select_id;
}
-static inline void setCurrentSelectId(PyTypeObject *type, PyObject *select_id)
-{
- SbkObjectType_SetReserved(type, PyLong_AsSsize_t(select_id));
-}
-
-static inline void setCurrentSelectId(PyTypeObject *type, int id)
-{
- SbkObjectType_SetReserved(type, id);
-}
-
static bool replaceClassDict(PyTypeObject *type)
{
/*
@@ -184,7 +174,6 @@ static bool replaceClassDict(PyTypeObject *type)
// Replace `__dict__` which usually has refcount 1 (but see cyclic_test.py)
Py_DECREF(type->tp_dict);
type->tp_dict = new_dict;
- setCurrentSelectId(type, select_id.object());
return true;
}
@@ -205,7 +194,6 @@ static bool addNewDict(PyTypeObject *type, PyObject *select_id)
setNextDict(dict, new_dict);
setNextDict(new_dict, next_dict);
type->tp_dict = new_dict;
- setCurrentSelectId(type, select_id);
return true;
}
@@ -222,13 +210,11 @@ static inline bool moveToFeatureSet(PyTypeObject *type, PyObject *select_id)
// This works because small numbers are singleton objects.
if (current_id == select_id) {
type->tp_dict = dict;
- setCurrentSelectId(type, select_id);
return true;
}
dict = nextInCircle(dict);
} while (dict != initial_dict);
type->tp_dict = initial_dict;
- setCurrentSelectId(type, getSelectId(initial_dict));
return false;
}
@@ -261,7 +247,6 @@ static bool createNewFeatureSet(PyTypeObject *type, PyObject *select_id)
auto id = PyLong_AsSsize_t(select_id);
if (id == -1)
return false;
- setCurrentSelectId(type, id);
FeatureProc *proc = featurePointer;
for (int idx = id; *proc != nullptr; ++proc, idx >>= 1) {
if (idx & 1) {