Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Drop reference to Py_Main
Was only used in the console and might not be available in some
embedding scenarios.
  • Loading branch information
filmor committed Nov 8, 2024
commit 0e633fc8a34a738384e7ef075522e1ae766427bb
2 changes: 0 additions & 2 deletions src/runtime/Runtime.Delegates.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ static Delegates()
PyGILState_Ensure = (delegate* unmanaged[Cdecl]<PyGILState>)GetFunctionByName(nameof(PyGILState_Ensure), GetUnmanagedDll(_PythonDll));
PyGILState_Release = (delegate* unmanaged[Cdecl]<PyGILState, void>)GetFunctionByName(nameof(PyGILState_Release), GetUnmanagedDll(_PythonDll));
PyGILState_GetThisThreadState = (delegate* unmanaged[Cdecl]<PyThreadState*>)GetFunctionByName(nameof(PyGILState_GetThisThreadState), GetUnmanagedDll(_PythonDll));
Py_Main = (delegate* unmanaged[Cdecl]<int, IntPtr, int>)GetFunctionByName(nameof(Py_Main), GetUnmanagedDll(_PythonDll));
PyEval_InitThreads = (delegate* unmanaged[Cdecl]<void>)GetFunctionByName(nameof(PyEval_InitThreads), GetUnmanagedDll(_PythonDll));
PyEval_ThreadsInitialized = (delegate* unmanaged[Cdecl]<int>)GetFunctionByName(nameof(PyEval_ThreadsInitialized), GetUnmanagedDll(_PythonDll));
PyEval_AcquireLock = (delegate* unmanaged[Cdecl]<void>)GetFunctionByName(nameof(PyEval_AcquireLock), GetUnmanagedDll(_PythonDll));
Expand Down Expand Up @@ -319,7 +318,6 @@ static Delegates()
internal static delegate* unmanaged[Cdecl]<PyGILState> PyGILState_Ensure { get; }
internal static delegate* unmanaged[Cdecl]<PyGILState, void> PyGILState_Release { get; }
internal static delegate* unmanaged[Cdecl]<PyThreadState*> PyGILState_GetThisThreadState { get; }
internal static delegate* unmanaged[Cdecl]<int, IntPtr, int> Py_Main { get; }
internal static delegate* unmanaged[Cdecl]<void> PyEval_InitThreads { get; }
internal static delegate* unmanaged[Cdecl]<int> PyEval_ThreadsInitialized { get; }
internal static delegate* unmanaged[Cdecl]<void> PyEval_AcquireLock { get; }
Expand Down
14 changes: 0 additions & 14 deletions src/runtime/Runtime.cs
Original file line number Diff line number Diff line change
Expand Up @@ -719,20 +719,6 @@ internal static T TryUsingDll<T>(Func<T> op)
internal static PyThreadState* PyGILState_GetThisThreadState() => Delegates.PyGILState_GetThisThreadState();


public static int Py_Main(int argc, string[] argv)
{
var marshaler = StrArrayMarshaler.GetInstance(null);
var argvPtr = marshaler.MarshalManagedToNative(argv);
try
{
return Delegates.Py_Main(argc, argvPtr);
}
finally
{
marshaler.CleanUpNativeData(argvPtr);
}
}

internal static void PyEval_InitThreads() => Delegates.PyEval_InitThreads();


Expand Down