mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-07-04 04:07:22 +00:00
Use IntPtr instead of int conversion for pointer in Memory.Pin() (#10485)
* Use IntPtr instead of int conversion for pointer in Memory.Pin() Co-authored-by: Lingfeng Wu <lingfw@microsoft.com>
This commit is contained in:
parent
d198fbc4d5
commit
3be3db5180
1 changed files with 1 additions and 1 deletions
|
|
@ -248,7 +248,7 @@ namespace Microsoft.ML.OnnxRuntime
|
|||
{
|
||||
throw new ArgumentOutOfRangeException(nameof(elementIndex));
|
||||
}
|
||||
return new MemoryHandle((void*)((int)_dataBufferPointer + elementIndex * ElementWidth)); //could not use Unsafe.Add
|
||||
return new MemoryHandle(new IntPtr(_dataBufferPointer.ToInt64() + (long)elementIndex * ElementWidth).ToPointer());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue