aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Include/moduleobject.h
diff options
context:
space:
mode:
authorEric Snow <ericsnowcurrently@gmail.com>2022-11-11 14:16:28 -0700
committerGitHub <noreply@github.com>2022-11-11 14:16:28 -0700
commitdd36b71fa6164ebba5d94bb4a24eac43b1c54906 (patch)
treeb80a158cde971908ead6d89f7ed75c82b736992f /Include/moduleobject.h
parentfe55ff3f68d56e11526652a21d8fe27444f96224 (diff)
downloadcpython-dd36b71fa6164ebba5d94bb4a24eac43b1c54906.tar.gz
cpython-dd36b71fa6164ebba5d94bb4a24eac43b1c54906.zip
gh-81057: Move the Extension Modules Cache to _PyRuntimeState (gh-99355)
We also move the closely related max_module_number and add comments documenting the group of struct members. https://github.com/python/cpython/issues/81057
Diffstat (limited to 'Include/moduleobject.h')
-rw-r--r--Include/moduleobject.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/Include/moduleobject.h b/Include/moduleobject.h
index fbb2c5ae794..555564ec73b 100644
--- a/Include/moduleobject.h
+++ b/Include/moduleobject.h
@@ -43,8 +43,22 @@ PyAPI_DATA(PyTypeObject) PyModuleDef_Type;
typedef struct PyModuleDef_Base {
PyObject_HEAD
+ /* The function used to re-initialize the module.
+ This is only set for legacy (single-phase init) extension modules
+ and only used for those that support multiple initializations
+ (m_size >= 0).
+ It is set by _PyImport_LoadDynamicModuleWithSpec()
+ and _imp.create_builtin(). */
PyObject* (*m_init)(void);
+ /* The module's index into its interpreter's modules_by_index cache.
+ This is set for all extension modules but only used for legacy ones.
+ (See PyInterpreterState.modules_by_index for more info.)
+ It is set by PyModuleDef_Init(). */
Py_ssize_t m_index;
+ /* A copy of the module's __dict__ after the first time it was loaded.
+ This is only set/used for legacy modules that do not support
+ multiple initializations.
+ It is set by _PyImport_FixupExtensionObject(). */
PyObject* m_copy;
} PyModuleDef_Base;