Skip to content

Commit

Permalink
bpo-1635741: Port _posixshmem extension module to multiphase initiali…
Browse files Browse the repository at this point in the history
…zation (GH-23404)

Signed-off-by: Christian Heimes <christian@python.org>
  • Loading branch information
tiran committed Nov 19, 2020
1 parent 588c7c9 commit b437aa8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 13 deletions.
@@ -0,0 +1 @@
Port _posixshmem extension module to multiphase initialization (:pep:`489`)
22 changes: 9 additions & 13 deletions Modules/_multiprocessing/posixshmem.c
Expand Up @@ -110,21 +110,17 @@ static PyMethodDef module_methods[ ] = {
};


static struct PyModuleDef this_module = {
PyModuleDef_HEAD_INIT, // m_base
"_posixshmem", // m_name
"POSIX shared memory module", // m_doc
-1, // m_size (space allocated for module globals)
module_methods, // m_methods
static struct PyModuleDef _posixshmemmodule = {
PyModuleDef_HEAD_INIT,
.m_name = "_posixshmem",
.m_doc = "POSIX shared memory module",
.m_size = 0,
.m_methods = module_methods,
};

/* Module init function */
PyMODINIT_FUNC
PyInit__posixshmem(void) {
PyObject *module;
module = PyModule_Create(&this_module);
if (!module) {
return NULL;
}
return module;
PyInit__posixshmem(void)
{
return PyModuleDef_Init(&_posixshmemmodule);
}

0 comments on commit b437aa8

Please sign in to comment.