1- From b7d722547bcc9e92dca4837b9fdbe7457788820b Mon Sep 17 00:00:00 2001
1+ From 805dec280697c8f6ee3707d015563430cc704cb7 Mon Sep 17 00:00:00 2001
22From: Kumar Aditya <kumaraditya@python.org>
33Date: Wed, 16 Jul 2025 22:09:08 +0530
4- Subject: [PATCH 1/1 ] gh-136669: build `_asyncio` as static module (#136670)
4+ Subject: [PATCH] gh-136669: build `_asyncio` as static module (#136670)
55
66`_asyncio` is now built as a static module so that thread states can be accessed directly via registers and avoids the overhead of function call.
77---
@@ -19,7 +19,7 @@ index 00000000000..0d93397ff35
1919@@ -0,0 +1 @@
2020+ :mod:`!_asyncio` is now statically linked for improved performance.
2121diff --git a/Modules/Setup.stdlib.in b/Modules/Setup.stdlib.in
22- index 3a38a60a152..86c8eb27c0a 100644
22+ index 905ea4aa2e5..7f4c4a80673 100644
2323--- a/Modules/Setup.stdlib.in
2424+++ b/Modules/Setup.stdlib.in
2525@@ -32,7 +32,6 @@
@@ -30,7 +30,7 @@ index 3a38a60a152..86c8eb27c0a 100644
3030 @MODULE__BISECT_TRUE@_bisect _bisectmodule.c
3131 @MODULE__CSV_TRUE@_csv _csv.c
3232 @MODULE__HEAPQ_TRUE@_heapq _heapqmodule.c
33- @@ -193 ,3 +192 ,9 @@
33+ @@ -190 ,3 +189 ,9 @@
3434 # Limited API template modules; must be built as shared modules.
3535 @MODULE_XXLIMITED_TRUE@xxlimited xxlimited.c
3636 @MODULE_XXLIMITED_35_TRUE@xxlimited_35 xxlimited_35.c
@@ -41,31 +41,31 @@ index 3a38a60a152..86c8eb27c0a 100644
4141+
4242+ @MODULE__ASYNCIO_TRUE@_asyncio _asynciomodule.c
4343diff --git a/Modules/_remote_debugging_module.c b/Modules/_remote_debugging_module.c
44- index d72031137e0..b50e5e403a1 100644
44+ index a26e6820f55..a8c9b077a09 100644
4545--- a/Modules/_remote_debugging_module.c
4646+++ b/Modules/_remote_debugging_module.c
47- @@ -811 ,7 +811 ,7 @@ _Py_RemoteDebug_GetAsyncioDebugAddress(proc_handle_t* handle)
47+ @@ -826 ,7 +826 ,7 @@ _Py_RemoteDebug_GetAsyncioDebugAddress(proc_handle_t* handle)
4848 }
4949 #elif defined(__linux__)
5050 // On Linux, search for asyncio debug in executable or DLL
51- - address = search_linux_map_for_section(handle, "AsyncioDebug", "_asyncio.cpython");
52- + address = search_linux_map_for_section(handle, "AsyncioDebug", "python");
51+ - address = search_linux_map_for_section(handle, "AsyncioDebug", "_asyncio.cpython", NULL );
52+ + address = search_linux_map_for_section(handle, "AsyncioDebug", "python", NULL );
5353 if (address == 0) {
5454 // Error out: 'python' substring covers both executable and DLL
5555 PyObject *exc = PyErr_GetRaisedException();
56- @@ -820 ,10 +820 ,10 @@ _Py_RemoteDebug_GetAsyncioDebugAddress(proc_handle_t* handle)
56+ @@ -835 ,10 +835 ,10 @@ _Py_RemoteDebug_GetAsyncioDebugAddress(proc_handle_t* handle)
5757 }
5858 #elif defined(__APPLE__) && TARGET_OS_OSX
5959 // On macOS, try libpython first, then fall back to python
60- - address = search_map_for_section(handle, "AsyncioDebug", "_asyncio.cpython");
61- + address = search_map_for_section(handle, "AsyncioDebug", "libpython");
60+ - address = search_map_for_section(handle, "AsyncioDebug", "_asyncio.cpython", NULL );
61+ + address = search_map_for_section(handle, "AsyncioDebug", "libpython", NULL );
6262 if (address == 0) {
6363 PyErr_Clear();
64- - address = search_map_for_section(handle, "AsyncioDebug", "_asyncio.cpython");
65- + address = search_map_for_section(handle, "AsyncioDebug", "python");
64+ - address = search_map_for_section(handle, "AsyncioDebug", "_asyncio.cpython", NULL );
65+ + address = search_map_for_section(handle, "AsyncioDebug", "python", NULL );
6666 }
6767 if (address == 0) {
6868 // Error out: 'python' substring covers both executable and DLL
6969- -
70- 2.39.5 (Apple Git-154 )
70+ 2.50.1 (Apple Git-155 )
7171
0 commit comments