Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
cython
Commits
d3ddbddb
Commit
d3ddbddb
authored
Aug 25, 2012
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
clean up injection of RegisterModuleCleanup utility code
parent
ae33c0ec
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
Cython/Compiler/ModuleNode.py
Cython/Compiler/ModuleNode.py
+2
-3
Cython/Utility/ModuleSetupCode.c
Cython/Utility/ModuleSetupCode.c
+1
-0
No files found.
Cython/Compiler/ModuleNode.py
View file @
d3ddbddb
...
@@ -1913,7 +1913,8 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
...
@@ -1913,7 +1913,8 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
if
Options
.
generate_cleanup_code
:
if
Options
.
generate_cleanup_code
:
# this should be replaced by the module's tp_clear in Py3
# this should be replaced by the module's tp_clear in Py3
env
.
use_utility_code
(
import_module_utility_code
)
code
.
globalstate
.
use_utility_code
(
UtilityCode
.
load_cached
(
"RegisterModuleCleanup"
,
"ModuleSetupCode.c"
))
code
.
putln
(
"if (__Pyx_RegisterCleanup()) %s;"
%
code
.
error_goto
(
self
.
pos
))
code
.
putln
(
"if (__Pyx_RegisterCleanup()) %s;"
%
code
.
error_goto
(
self
.
pos
))
code
.
put_goto
(
code
.
return_label
)
code
.
put_goto
(
code
.
return_label
)
...
@@ -1974,8 +1975,6 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
...
@@ -1974,8 +1975,6 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
def
generate_module_cleanup_func
(
self
,
env
,
code
):
def
generate_module_cleanup_func
(
self
,
env
,
code
):
if
not
Options
.
generate_cleanup_code
:
if
not
Options
.
generate_cleanup_code
:
return
return
code
.
globalstate
.
use_utility_code
(
UtilityCode
.
load_cached
(
"RegisterModuleCleanup"
,
"ModuleSetupCode.c"
))
code
.
putln
(
'static PyObject *%s(CYTHON_UNUSED PyObject *self, CYTHON_UNUSED PyObject *unused) {'
%
code
.
putln
(
'static PyObject *%s(CYTHON_UNUSED PyObject *self, CYTHON_UNUSED PyObject *unused) {'
%
Naming
.
cleanup_cname
)
Naming
.
cleanup_cname
)
if
Options
.
generate_cleanup_code
>=
2
:
if
Options
.
generate_cleanup_code
>=
2
:
...
...
Cython/Utility/ModuleSetupCode.c
View file @
d3ddbddb
...
@@ -578,6 +578,7 @@ static PyObject* ${cleanup_cname}(CYTHON_UNUSED PyObject *self, CYTHON_UNUSED Py
...
@@ -578,6 +578,7 @@ static PyObject* ${cleanup_cname}(CYTHON_UNUSED PyObject *self, CYTHON_UNUSED Py
/////////////// RegisterModuleCleanup ///////////////
/////////////// RegisterModuleCleanup ///////////////
//@substitute: naming
//@substitute: naming
//@requires: ModuleImport
static
int
__Pyx_RegisterCleanup
(
void
)
{
static
int
__Pyx_RegisterCleanup
(
void
)
{
// Don't use Py_AtExit because that has a 32-call limit and is called
// Don't use Py_AtExit because that has a 32-call limit and is called
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment