From cf00b31b5d9882325d2124cb257fb6a3476e0d78 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Thu, 13 Feb 2025 13:12:24 +0900 Subject: [PATCH] Remove a stale function for MJIT --- win32/win32.c | 40 ---------------------------------------- 1 file changed, 40 deletions(-) diff --git a/win32/win32.c b/win32/win32.c index 44552a2016..a3dbee29f7 100644 --- a/win32/win32.c +++ b/win32/win32.c @@ -1309,46 +1309,6 @@ is_batch(const char *cmd) #define utf8_to_wstr(str, plen) mbstr_to_wstr(CP_UTF8, str, -1, plen) #define wstr_to_utf8(str, plen) wstr_to_mbstr(CP_UTF8, str, -1, plen) -/* License: Ruby's */ -HANDLE -rb_w32_start_process(const char *abspath, char *const *argv, int out_fd) -{ - /* NOTE: This function is used by RJIT worker, so it can be used parallelly with - Ruby's main thread. So functions touching things shared with main thread can't - be used, like `ALLOCV` that may trigger GC or `FindFreeChildSlot` that finds - a slot from shared memory without atomic locks. */ - struct ChildRecord child; - char *cmd; - size_t len; - WCHAR *wcmd = NULL, *wprog = NULL; - HANDLE outHandle = NULL; - - if (out_fd) { - outHandle = (HANDLE)rb_w32_get_osfhandle(out_fd); - } - - len = join_argv(NULL, argv, FALSE, filecp(), 1); - cmd = alloca(sizeof(char) * len); - join_argv(cmd, argv, FALSE, filecp(), 1); - - if (!(wcmd = mbstr_to_wstr(filecp(), cmd, -1, NULL))) { - errno = E2BIG; - return NULL; - } - if (!(wprog = mbstr_to_wstr(filecp(), abspath, -1, NULL))) { - errno = E2BIG; - return NULL; - } - - if (!CreateChild(&child, wcmd, wprog, NULL, outHandle, outHandle, 0)) { - return NULL; - } - - free(wcmd); - free(wprog); - return child.hProcess; -} - /* License: Artistic or GPL */ static rb_pid_t w32_spawn(int mode, const char *cmd, const char *prog, UINT cp)