Repository navigation
Commit 0fe7b59
committed
ctypes: do not re-lock the destination in PyCData_set()
PyCData_set() already requires its caller to hold the critical section
on the destination object and asserts it, but finished by calling
KeepRef(), which takes that lock again. Every store of a Python object
into a Structure or Union field, an Array item or a Pointer item went
through it. Call KeepRef_lock_held() instead.
Measured on the free-threaded build: Structure int field assignment
38 -> 24 ns, c_char_p field assignment 69 -> 54 ns.
(cherry picked from commit ead0976)1 parent 60f8473 commit 0fe7b59
1 file changed
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3563 | 3563 | | |
3564 | 3564 | | |
3565 | 3565 | | |
3566 | | - | |
| 3566 | + | |
3567 | 3567 | | |
3568 | 3568 | | |
3569 | 3569 | | |
| |||
0 commit comments