Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita5e628b

Browse files
authored
gh-91048: Prevent optimizing away the asyncio debug offsets structure on Windows (#132963)
To avoid having the debug sections being optimised away by the compilerwe use __attribute__((used)) on gcc and clang but in Windows this isnot supported by the Microsoft compiler and there is no equivalent flag.Unfortunately Windows offers almost no alternative other than exportingthe symbol in the dynamic table or using it somehow.
1 parenta1f4a6b commita5e628b

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

‎Modules/_asynciomodule.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,10 @@ typedef struct {
185185
/* Counter for autogenerated Task names */
186186
uint64_ttask_name_counter;
187187

188+
/* Pointer to the asyncio debug offset to avoid it to be optimized away
189+
by the compiler */
190+
void*debug_offsets;
191+
188192
}asyncio_state;
189193

190194
staticinlineasyncio_state*
@@ -4320,6 +4324,8 @@ module_init(asyncio_state *state)
43204324
gotofail;
43214325
}
43224326

4327+
state->debug_offsets=&_AsyncioDebug;
4328+
43234329
Py_DECREF(module);
43244330
return0;
43254331

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp