File tree Expand file tree Collapse file tree 2 files changed +4
-10
lines changed
Microsoft.Toolkit.HighPerformance/Memory Expand file tree Collapse file tree 2 files changed +4
-10
lines changed Original file line number Diff line number Diff line change @@ -786,11 +786,8 @@ public bool TryGetMemory(out Memory<T> memory)
786786 }
787787 else if ( this . instance is MemoryManager < T > memoryManager )
788788 {
789- unsafe
790- {
791- // If the object is a MemoryManager<T>, just slice it as needed
792- memory = memoryManager . Memory . Slice ( ( int ) ( void * ) this . offset , this . height * this . width ) ;
793- }
789+ // If the object is a MemoryManager<T>, just slice it as needed
790+ memory = memoryManager . Memory . Slice ( ( int ) ( nint ) this . offset , this . height * this . width ) ;
794791 }
795792 else if ( this . instance . GetType ( ) == typeof ( T [ ] ) )
796793 {
Original file line number Diff line number Diff line change @@ -802,11 +802,8 @@ public bool TryGetMemory(out ReadOnlyMemory<T> memory)
802802 }
803803 else if ( this . instance is MemoryManager < T > memoryManager )
804804 {
805- unsafe
806- {
807- // If the object is a MemoryManager<T>, just slice it as needed
808- memory = memoryManager . Memory . Slice ( ( int ) ( void * ) this . offset , this . height * this . width ) ;
809- }
805+ // If the object is a MemoryManager<T>, just slice it as needed
806+ memory = memoryManager . Memory . Slice ( ( int ) ( nint ) this . offset , this . height * this . width ) ;
810807 }
811808 else if ( this . instance . GetType ( ) == typeof ( T [ ] ) )
812809 {
You can’t perform that action at this time.
0 commit comments