Skip to content

Commit 47406f1

Browse files
committed
Remove unused code: execute_direct function and async_pending_t.ref field
1 parent 2b02f6e commit 47406f1

2 files changed

Lines changed: 4 additions & 21 deletions

File tree

c_src/py_exec.c

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1070,22 +1070,8 @@ static void multi_executor_stop(void) {
10701070
g_multi_executor_initialized = false;
10711071
}
10721072

1073-
/* ============================================================================
1074-
* Free-threaded execution (Python 3.13+ nogil)
1075-
* ============================================================================ */
1076-
1077-
#ifdef HAVE_FREE_THREADED
1078-
/**
1079-
* Execute a request directly in free-threaded mode.
1080-
* No GIL management needed - Python handles synchronization internally.
1073+
/*
1074+
* Note: Free-threaded execution (Python 3.13+ nogil) is handled inline
1075+
* in executor_enqueue() using PyGILState_Ensure/Release which are no-ops
1076+
* in free-threaded builds but still work correctly.
10811077
*/
1082-
static ERL_NIF_TERM execute_direct(ErlNifEnv *env, py_request_t *req) {
1083-
/* In free-threaded mode, PyGILState functions still work but are essentially no-ops */
1084-
PyGILState_STATE gstate = PyGILState_Ensure();
1085-
1086-
process_request(req);
1087-
1088-
PyGILState_Release(gstate);
1089-
return req->result;
1090-
}
1091-
#endif

c_src/py_nif.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -254,9 +254,6 @@ typedef struct async_pending {
254254
/** @brief PID of the Erlang process awaiting the result */
255255
ErlNifPid caller;
256256

257-
/** @brief Reference term for correlation (unused, reserved) */
258-
ERL_NIF_TERM ref;
259-
260257
/** @brief Next pending operation in the queue */
261258
struct async_pending *next;
262259
} async_pending_t;

0 commit comments

Comments
 (0)