We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7ee651c commit c15c9c3Copy full SHA for c15c9c3
src/runtime/loader.cs
@@ -10,14 +10,12 @@ namespace Python.Runtime
10
[Obsolete("Only to be used from within Python")]
11
static class Loader
12
{
13
- public static int Initialize(IntPtr data, int size)
+ public unsafe static int Initialize(IntPtr data, int size)
14
15
IntPtr gs = IntPtr.Zero;
16
try
17
18
- var buf = new byte[size];
19
- Marshal.Copy(data, buf, 0, size);
20
- var dllPath = Encoding.UTF8.GetString(buf);
+ var dllPath = Encoding.UTF8.GetString((byte*)data.ToPointer(), size);
21
22
if (!string.IsNullOrEmpty(dllPath))
23
0 commit comments