@@ -427,7 +427,7 @@ public static void MemcpyT<T>(T* src, T* dst, int length) where T : unmanaged
427427 [ MethodImpl ( MethodImplOptions . AggressiveInlining ) ]
428428 public static void ZeroMemoryT < T > ( T * pointer ) where T : unmanaged
429429 {
430- Unsafe . InitBlock ( pointer , 0 , ( uint ) sizeof ( T ) ) ;
430+ Unsafe . InitBlockUnaligned ( pointer , 0 , ( uint ) sizeof ( T ) ) ;
431431 }
432432
433433 /// <summary>
@@ -474,7 +474,7 @@ public static void ZeroMemoryT<T>(T* pointer, nint length) where T : unmanaged
474474 [ MethodImpl ( MethodImplOptions . AggressiveInlining ) ]
475475 public static void ZeroMemory ( void * pointer , uint size )
476476 {
477- Unsafe . InitBlock ( pointer , 0 , size ) ;
477+ Unsafe . InitBlockUnaligned ( pointer , 0 , size ) ;
478478 }
479479
480480 /// <summary>
@@ -485,7 +485,7 @@ public static void ZeroMemory(void* pointer, uint size)
485485 [ MethodImpl ( MethodImplOptions . AggressiveInlining ) ]
486486 public static void ZeroMemory ( void * pointer , int size )
487487 {
488- Unsafe . InitBlock ( pointer , 0 , ( uint ) size ) ;
488+ Unsafe . InitBlockUnaligned ( pointer , 0 , ( uint ) size ) ;
489489 }
490490
491491 /// <summary>
@@ -498,13 +498,13 @@ public static void ZeroMemory(void* pointer, ulong size)
498498 {
499499 while ( size > uint . MaxValue )
500500 {
501- Unsafe . InitBlock ( pointer , 0 , uint . MaxValue ) ;
501+ Unsafe . InitBlockUnaligned ( pointer , 0 , uint . MaxValue ) ;
502502 size -= uint . MaxValue ;
503503 }
504504
505505 if ( size > 0 )
506506 {
507- Unsafe . InitBlock ( pointer , 0 , ( uint ) size ) ;
507+ Unsafe . InitBlockUnaligned ( pointer , 0 , ( uint ) size ) ;
508508 }
509509 }
510510
@@ -518,13 +518,13 @@ public static void ZeroMemory(void* pointer, long size)
518518 {
519519 while ( size > uint . MaxValue )
520520 {
521- Unsafe . InitBlock ( pointer , 0 , uint . MaxValue ) ;
521+ Unsafe . InitBlockUnaligned ( pointer , 0 , uint . MaxValue ) ;
522522 size -= uint . MaxValue ;
523523 }
524524
525525 if ( size > 0 )
526526 {
527- Unsafe . InitBlock ( pointer , 0 , ( uint ) size ) ;
527+ Unsafe . InitBlockUnaligned ( pointer , 0 , ( uint ) size ) ;
528528 }
529529 }
530530
@@ -1247,25 +1247,6 @@ public static void MemsetT<T>(T* ptr, T value, int count) where T : unmanaged
12471247 }
12481248 }
12491249
1250- public static string ? NullReturn ( )
1251- {
1252- return null ;
1253- }
1254-
1255- public static void Main ( )
1256- {
1257- string ? str = NullReturn ( ) ;
1258- str ??= string . Empty ;
1259- str = str . Trim ( ) ;
1260-
1261- object ? obj = str ;
1262-
1263- if ( obj is string s )
1264- {
1265- Console . WriteLine ( s ) ;
1266- }
1267- }
1268-
12691250 /// <summary>
12701251 /// Sets the memory at the specified pointer to the specified value for a given number of elements.
12711252 /// </summary>
0 commit comments