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

Skip to content

Commit d1044c3

Browse files
amos402filmor
authored andcommitted
Remove unnecessary CopySlot calls (#1004)
1 parent abbe870 commit d1044c3

File tree

1 file changed

+5
-11
lines changed

1 file changed

+5
-11
lines changed

src/runtime/typemanager.cs

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -309,17 +309,11 @@ internal static IntPtr CreateMetaType(Type impl)
309309
Marshal.WriteIntPtr(type, TypeOffset.tp_base, py_type);
310310
Runtime.XIncref(py_type);
311311

312-
// Copy gc and other type slots from the base Python metatype.
313-
314-
CopySlot(py_type, type, TypeOffset.tp_basicsize);
315-
CopySlot(py_type, type, TypeOffset.tp_itemsize);
316-
317-
CopySlot(py_type, type, TypeOffset.tp_dictoffset);
318-
CopySlot(py_type, type, TypeOffset.tp_weaklistoffset);
319-
320-
CopySlot(py_type, type, TypeOffset.tp_traverse);
321-
CopySlot(py_type, type, TypeOffset.tp_clear);
322-
CopySlot(py_type, type, TypeOffset.tp_is_gc);
312+
// Slots will inherit from TypeType, it's not neccesary for setting them.
313+
// Inheried slots:
314+
// tp_basicsize, tp_itemsize,
315+
// tp_dictoffset, tp_weaklistoffset,
316+
// tp_traverse, tp_clear, tp_is_gc, etc.
323317

324318
// Override type slots with those of the managed implementation.
325319

0 commit comments

Comments
 (0)