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

Commit00d2604

Browse files
committed
gh-91048: Prevent optimizing away the asyncio debug offsets structure on Windows
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 parent17718b0 commit00d2604

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

‎Modules/_asynciomodule.c‎

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

188+
#ifdefMS_WINDOWS
189+
/* Pointer to the asyncio debug offset to avoid it to be optimized away
190+
by the compiler in Windows (other platforms don't need this) */
191+
void*debug_offsets;
192+
#endif
193+
188194
}asyncio_state;
189195

190196
staticinlineasyncio_state*
@@ -4320,6 +4326,10 @@ module_init(asyncio_state *state)
43204326
gotofail;
43214327
}
43224328

4329+
#ifdefMS_WINDOWS
4330+
state->debug_offsets=&_AsyncioDebug;
4331+
#endif
4332+
43234333
Py_DECREF(module);
43244334
return0;
43254335

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp