@@ -500,7 +500,6 @@ internal static Type[] PythonArgsToTypeArray(IntPtr arg, bool mangleObjects)
500
500
internal static unsafe void XIncref ( IntPtr op )
501
501
{
502
502
#if PYTHON_WITH_PYDEBUG
503
- // according to Python doc, Py_IncRef() is Py_XINCREF()
504
503
Py_IncRef ( op ) ;
505
504
return ;
506
505
#else
@@ -522,8 +521,6 @@ internal static unsafe void XIncref(IntPtr op)
522
521
internal static unsafe void XDecref ( IntPtr op )
523
522
{
524
523
#if PYTHON_WITH_PYDEBUG
525
- // Py_DecRef calls Python's Py_DECREF
526
- // according to Python doc, Py_DecRef() is Py_XDECREF()
527
524
Py_DecRef ( op ) ;
528
525
return ;
529
526
#else
@@ -568,15 +565,21 @@ internal static unsafe long Refcount(IntPtr op)
568
565
return Is32Bit ? ( * ( int * ) p ) : ( * ( long * ) p ) ;
569
566
}
570
567
571
- #if PYTHON_WITH_PYDEBUG
572
- // Py_IncRef and Py_DecRef are taking care of the extra payload
573
- // in Py_DEBUG builds of Python like _Py_RefTotal
568
+ /// <summary>
569
+ /// Export of Macro Py_XIncRef. Use XIncref instead.
570
+ /// Limit this function usage for Testing and Py_Debug builds
571
+ /// </summary>
572
+ /// <param name="ob">PyObject Ptr</param>
574
573
[ DllImport ( PythonDll ) ]
575
- private static extern void Py_IncRef( IntPtr ob ) ;
574
+ internal static extern void Py_IncRef( IntPtr ob ) ;
576
575
576
+ /// <summary>
577
+ /// Export of Macro Py_XDecRef. Use XDecref instead.
578
+ /// Limit this function usage for Testing and Py_Debug builds
579
+ /// </summary>
580
+ /// <param name="ob">PyObject Ptr</param>
577
581
[ DllImport ( PythonDll ) ]
578
- private static extern void Py_DecRef ( IntPtr ob ) ;
579
- #endif
582
+ internal static extern void Py_DecRef( IntPtr ob ) ;
580
583
581
584
[ DllImport ( PythonDll ) ]
582
585
internal static extern void Py_Initialize( ) ;
0 commit comments