Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit db9d92c

Browse files
Drop the XID type registry.
1 parent a3ef45a commit db9d92c

1 file changed

Lines changed: 0 additions & 36 deletions

File tree

Modules/_xxinterpchannelsmodule.c

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -93,38 +93,6 @@ API.. The module does not create any objects that are shared globally.
9393
PyMem_RawFree(VAR)
9494

9595

96-
struct xid_class_registry {
97-
size_t count;
98-
#define MAX_XID_CLASSES 5
99-
struct {
100-
PyTypeObject *cls;
101-
} added[MAX_XID_CLASSES];
102-
};
103-
104-
static int
105-
register_xid_class(PyTypeObject *cls, crossinterpdatafunc shared,
106-
struct xid_class_registry *classes)
107-
{
108-
int res = ensure_xid_class(cls, shared);
109-
if (res == 0) {
110-
assert(classes->count < MAX_XID_CLASSES);
111-
// The class has refs elsewhere, so we need to incref here.
112-
classes->added[classes->count].cls = cls;
113-
classes->count += 1;
114-
}
115-
return res;
116-
}
117-
118-
static void
119-
clear_xid_class_registry(struct xid_class_registry *classes)
120-
{
121-
while (classes->count > 0) {
122-
classes->count -= 1;
123-
PyTypeObject *cls = classes->added[classes->count].cls;
124-
_PyCrossInterpreterData_UnregisterClass(cls);
125-
}
126-
}
127-
12896
#define XID_IGNORE_EXC 1
12997
#define XID_FREE 2
13098

@@ -247,8 +215,6 @@ wait_for_lock(PyThread_type_lock mutex, PY_TIMEOUT_T timeout)
247215
/* module state *************************************************************/
248216

249217
typedef struct {
250-
struct xid_class_registry xid_classes;
251-
252218
/* Added at runtime by interpreters module. */
253219
PyTypeObject *send_channel_type;
254220
PyTypeObject *recv_channel_type;
@@ -313,8 +279,6 @@ traverse_module_state(module_state *state, visitproc visit, void *arg)
313279
static void
314280
clear_xid_types(module_state *state)
315281
{
316-
clear_xid_class_registry(&state->xid_classes);
317-
318282
/* external types */
319283
if (state->send_channel_type != NULL) {
320284
(void)_PyCrossInterpreterData_UnregisterClass(state->send_channel_type);

0 commit comments

Comments
 (0)