File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -253,11 +253,19 @@ static int SumSegmentsLength(ReadOnlySpan<string?> segmentsInner)
253253 /// </summary>
254254 /// <param name="str">A string to get its pointer from.</param>
255255 /// <returns>A pinned pointer of the string.</returns>
256- public static unsafe char * GetPinnableStringPointer( this string str)
256+ public static unsafe char * GetPinnableStringPointer( this string ? str)
257257 {
258258 fixed ( char * ptr = & Utf16StringMarshaller . GetPinnableReference ( str ) )
259259 {
260260 return ptr;
261261 }
262262 }
263+
264+ // ReSharper disable once IdentifierTypo
265+ // ReSharper disable once CommentTypo
266+ public static unsafe nint GetPinnableStringPointerSafe( this string ? str )
267+ {
268+ char * p = str. GetPinnableStringPointer( ) ;
269+ return ( nint ) p ;
270+ }
263271}
You can’t perform that action at this time.
0 commit comments