@@ -14,6 +14,7 @@ ref struct NewReference
14
14
IntPtr pointer ;
15
15
16
16
/// <summary>Creates a <see cref="NewReference"/> pointing to the same object</summary>
17
+ [ DebuggerHidden ]
17
18
public NewReference ( BorrowedReference reference , bool canBeNull = false )
18
19
{
19
20
var address = canBeNull
@@ -69,13 +70,15 @@ public IntPtr DangerousMoveToPointerOrNull()
69
70
/// that steals reference passed to it.
70
71
/// </summary>
71
72
[ MethodImpl ( MethodImplOptions . AggressiveInlining ) ]
73
+ [ DebuggerHidden ]
72
74
public StolenReference StealNullable ( ) => StolenReference . TakeNullable ( ref this . pointer ) ;
73
75
74
76
/// <summary>
75
77
/// Call this method to move ownership of this reference to a Python C API function,
76
78
/// that steals reference passed to it.
77
79
/// </summary>
78
80
[ MethodImpl ( MethodImplOptions . AggressiveInlining ) ]
81
+ [ DebuggerHidden ]
79
82
public StolenReference Steal ( )
80
83
{
81
84
if ( this . IsNull ( ) ) throw new NullReferenceException ( ) ;
@@ -118,6 +121,7 @@ public static NewReference DangerousFromPointer(IntPtr pointer)
118
121
internal static IntPtr DangerousGetAddress ( in NewReference reference )
119
122
=> IsNull ( reference ) ? throw new NullReferenceException ( ) : reference . pointer ;
120
123
[ Pure ]
124
+ [ DebuggerHidden ]
121
125
internal static bool IsNull ( in NewReference reference )
122
126
=> reference . pointer == IntPtr . Zero ;
123
127
}
@@ -131,17 +135,21 @@ static class NewReferenceExtensions
131
135
{
132
136
/// <summary>Gets a raw pointer to the Python object</summary>
133
137
[ Pure ]
138
+ [ DebuggerHidden ]
134
139
public static IntPtr DangerousGetAddress ( this in NewReference reference )
135
140
=> NewReference . DangerousGetAddress ( reference ) ;
136
141
[ Pure ]
142
+ [ DebuggerHidden ]
137
143
public static bool IsNull ( this in NewReference reference )
138
144
=> NewReference . IsNull ( reference ) ;
139
145
140
146
141
147
[ Pure ]
148
+ [ DebuggerHidden ]
142
149
public static BorrowedReference BorrowNullable ( this in NewReference reference )
143
150
=> new ( NewReference . DangerousGetAddressOrNull ( reference ) ) ;
144
151
[ Pure ]
152
+ [ DebuggerHidden ]
145
153
public static BorrowedReference Borrow ( this in NewReference reference )
146
154
=> reference . IsNull ( ) ? throw new NullReferenceException ( ) : reference . BorrowNullable ( ) ;
147
155
[ Pure ]
@@ -150,6 +158,7 @@ public static BorrowedReference BorrowOrThrow(this in NewReference reference)
150
158
=> reference . IsNull ( ) ? throw PythonException . ThrowLastAsClrException ( ) : reference . BorrowNullable ( ) ;
151
159
152
160
[ Obsolete ]
161
+ [ DebuggerHidden ]
153
162
public static NewReference AnalyzerWorkaround ( this in NewReference reference )
154
163
=> NewReference . DangerousFromPointer ( reference . DangerousGetAddress ( ) ) ;
155
164
}
0 commit comments