Skip to content

Commit ede0417

Browse files
committed
perf: add free-threaded Python (3.13t+) safety with per-object critical sections
Use Py_BEGIN_CRITICAL_SECTION / Py_END_CRITICAL_SECTION to protect concurrent access to xxhash_state in all four hash types. - Python >= 3.13: uses PyObject's built-in ob_mutex via critical section - Python < 3.13: macros expand to nothing (GIL protects us) - GIL build (3.13+): macros expand to nothing (zero overhead) - Free-threaded build (3.13t+): real per-object locking - Locked operations: do_update, digest, hexdigest, intdigest, copy, reset, dealloc, init
1 parent c0f71ae commit ede0417

1 file changed

Lines changed: 153 additions & 64 deletions

File tree

0 commit comments

Comments
 (0)