Skip to content

Commit 9486b1e

Browse files
committed
pythongh-92356: Fix regression in ctypes function call overhead
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 b295a92 commit 9486b1e

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)