@@ -95,9 +95,7 @@ public static bool IsComparisonOp(MethodInfo method)
9595 /// For the operator methods of a CLR type, set the special slots of the
9696 /// corresponding Python type's operator methods.
9797 /// </summary>
98- /// <param name="pyType"></param>
99- /// <param name="clrType"></param>
100- public static void FixupSlots ( IntPtr pyType , Type clrType )
98+ public static void FixupSlots ( BorrowedReference pyType , Type clrType )
10199 {
102100 const BindingFlags flags = BindingFlags . Public | BindingFlags . Static ;
103101 Debug . Assert ( _opType != null ) ;
@@ -117,12 +115,12 @@ public static void FixupSlots(IntPtr pyType, Type clrType)
117115 int offset = OpMethodMap [ method . Name ] . TypeOffset ;
118116 // Copy the default implementation of e.g. the nb_add slot,
119117 // which simply calls __add__ on the type.
120- IntPtr func = Marshal . ReadIntPtr ( _opType . Handle , offset ) ;
118+ IntPtr func = Util . ReadIntPtr ( _opType , offset ) ;
121119 // Write the slot definition of the target Python type, so
122120 // that we can later modify __add___ and it will be called
123121 // when used with a Python operator.
124122 // https://tenthousandmeters.com/blog/python-behind-the-scenes-6-how-python-object-system-works/
125- Marshal . WriteIntPtr ( pyType , offset , func ) ;
123+ Util . WriteIntPtr ( pyType , offset , func ) ;
126124 }
127125 }
128126
0 commit comments