Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Jul 22, 2023. It is now read-only.
/pythonnetPublic archive
forked frompythonnet/pythonnet

Commita14ff14

Browse files
committed
Combine Py_DEBUG and PYTHON_WITH_PYDEBUG flags
They both refer to the PyDebug builds but were added at different times.Closespythonnet#362
1 parent3225465 commita14ff14

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

‎src/runtime/interop.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ static ObjectOffset()
7575
{
7676
intsize=IntPtr.Size;
7777
varn=0;// Py_TRACE_REFS add two pointers to PyObject_HEAD
78-
#ifPy_DEBUG
78+
#ifPYTHON_WITH_PYDEBUG
7979
_ob_next=0;
8080
_ob_prev=1*size;
8181
n=2;
@@ -113,14 +113,14 @@ public static int Size(IntPtr ob)
113113
{
114114
returnExceptionOffset.Size();
115115
}
116-
#ifPy_DEBUG
116+
#ifPYTHON_WITH_PYDEBUG
117117
return6*IntPtr.Size;
118118
#else
119119
return4*IntPtr.Size;
120120
#endif
121121
}
122122

123-
#ifPy_DEBUG
123+
#ifPYTHON_WITH_PYDEBUG
124124
publicstaticint_ob_next;
125125
publicstaticint_ob_prev;
126126
#endif
@@ -185,7 +185,7 @@ static BytesOffset()
185185

186186
/* The *real* layout of a type object when allocated on the heap */
187187
//typedef struct _heaptypeobject {
188-
#ifPy_DEBUG// #ifdef Py_TRACE_REFS
188+
#ifPYTHON_WITH_PYDEBUG
189189
/* _PyObject_HEAD_EXTRA defines pointers to support a doubly-linked list of all live heap objects. */
190190
publicstaticint_ob_next=0;
191191
publicstaticint_ob_prev=0;

‎src/runtime/runtime.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -508,7 +508,7 @@ internal static Type[] PythonArgsToTypeArray(IntPtr arg, bool mangleObjects)
508508
/// </summary>
509509
internalstaticunsafevoidXIncref(IntPtrop)
510510
{
511-
#ifPy_DEBUG
511+
#ifPYTHON_WITH_PYDEBUG
512512
// according to Python doc, Py_IncRef() is Py_XINCREF()
513513
Py_IncRef(op);
514514
return;
@@ -530,7 +530,7 @@ internal static unsafe void XIncref(IntPtr op)
530530

531531
internalstaticunsafevoidXDecref(IntPtrop)
532532
{
533-
#ifPy_DEBUG
533+
#ifPYTHON_WITH_PYDEBUG
534534
// Py_DecRef calls Python's Py_DECREF
535535
// according to Python doc, Py_DecRef() is Py_XDECREF()
536536
Py_DecRef(op);
@@ -584,7 +584,7 @@ internal static unsafe long Refcount(IntPtr op)
584584
return0;
585585
}
586586

587-
#ifPy_DEBUG
587+
#ifPYTHON_WITH_PYDEBUG
588588
// Py_IncRef and Py_DecRef are taking care of the extra payload
589589
// in Py_DEBUG builds of Python like _Py_RefTotal
590590
[DllImport(PythonDll)]
@@ -781,7 +781,7 @@ internal static unsafe IntPtr PyObject_TYPE(IntPtr op)
781781
{
782782
returnIntPtr.Zero;
783783
}
784-
#ifPy_DEBUG
784+
#ifPYTHON_WITH_PYDEBUG
785785
varn=3;
786786
#else
787787
var n=1;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp