gh-140550: Use a bool for the Py_mod_gil value (GH-141519)

This needs a single bit, but was stored as a void* in the module
struct. This didn't matter due to packing, but now that there's
another bool in the struct, we can save a bit of memory by
making md_gil a bool.

Variables that changed type are renamed, to detect conflicts.
This commit is contained in:
Petr Viktorin 2025-11-14 10:38:49 +01:00 committed by GitHub
parent 4885ecfbda
commit a4dd66275b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 24 additions and 21 deletions

View file

@ -30,7 +30,7 @@ typedef struct {
PyObject *md_name;
bool md_token_is_def; /* if true, `md_token` is the PyModuleDef */
#ifdef Py_GIL_DISABLED
void *md_gil;
bool md_requires_gil;
#endif
Py_ssize_t md_state_size;
traverseproc md_state_traverse;