8000 gh-92356: Fix regression in ctypes function call overhead (#92357) · python/cpython@adcb6a6 · GitHub
[go: up one dir, main page]

Skip to content

Commit adcb6a6

Browse files
authored
gh-92356: Fix regression in ctypes function call overhead (#92357)
38f331d introduced a delayed initialization routine to set up ctypes formattable (`_ctypes_init_fielddesc`), but inadvertently removed setting the `initialization` flag to 1 to avoid initting each time.
1 parent 301351c commit adcb6a6

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fixed a performance regression in ctypes function calls.

Modules/_ctypes/cfield.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1602,6 +1602,7 @@ _ctypes_get_fielddesc(const char *fmt)
16021602
struct fielddesc *table = formattable;
16031603

16041604
if (!initialized) {
1605+
initialized = 1;
16051606
_ctypes_init_fielddesc();
16061607
}
16071608

0 commit comments

Comments
 (0)
0