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
Kirill Smelkov
cython
Commits
d63cef62
Commit
d63cef62
authored
Feb 01, 2008
by
Robert Bradshaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Mangle naming for cleanup function.
parent
c0c5209f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
4 deletions
+9
-4
Cython/Compiler/CmdLine.py
Cython/Compiler/CmdLine.py
+2
-0
Cython/Compiler/ModuleNode.py
Cython/Compiler/ModuleNode.py
+6
-4
Cython/Compiler/Naming.py
Cython/Compiler/Naming.py
+1
-0
No files found.
Cython/Compiler/CmdLine.py
View file @
d63cef62
...
...
@@ -24,6 +24,8 @@ Options:
"from <module> import *" at the top of the file.
--incref-local-binop Force local an extra incref on local variables before
performing any binary operations.
--cleanup <level> Release interned objects on python exit, for memory debugging.
Level indicates aggressiveness, default 0 releases nothing.
-D, --no-docstrings Remove docstrings.
-a, --annotate Produce an colorized version of the source.
--convert-range Convert for loops using range() function to for...from loops.
...
...
Cython/Compiler/ModuleNode.py
View file @
d63cef62
...
...
@@ -1339,10 +1339,12 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
env
.
use_utility_code
(
import_module_utility_code
)
env
.
use_utility_code
(
register_cleanup_utility_code
)
code
.
putln
()
code
.
putln
(
'static PyObject*
cleanup(PyObject *self, PyObject *unused) {'
)
code
.
putln
(
'static PyObject*
%s(PyObject *self, PyObject *unused) {'
%
Naming
.
cleanup_cname
)
if
Options
.
generate_cleanup_code
>=
2
:
code
.
putln
(
"/*--- Global cleanup code ---*/"
)
for
entry
in
reversed
(
env
.
var_entries
):
rev_entries
=
list
(
env
.
var_entries
)
rev_entries
.
reverse
()
for
entry
in
rev_entries
:
if
entry
.
visibility
!=
'extern'
:
if
entry
.
type
.
is_pyobject
:
code
.
put_var_decref_clear
(
entry
)
...
...
@@ -1790,8 +1792,8 @@ bad:
register_cleanup_utility_code
=
[
"""
static int __Pyx_RegisterCleanup(void); /*proto*/
static PyObject* cleanup(PyObject *self, PyObject *unused); /*proto*/
static PyMethodDef cleanup_def = {"__cleanup", (PyCFunction)&cleanup, METH_NOARGS, 0};
static PyObject*
__pyx_module_
cleanup(PyObject *self, PyObject *unused); /*proto*/
static PyMethodDef cleanup_def = {"__cleanup", (PyCFunction)&
__pyx_module_
cleanup, METH_NOARGS, 0};
"""
,
"""
static int __Pyx_RegisterCleanup(void) {
/* Don't use Py_AtExit because that has a 32-call limit
...
...
Cython/Compiler/Naming.py
View file @
d63cef62
...
...
@@ -59,6 +59,7 @@ c_api_tab_cname = pyrex_prefix + "c_api_tab"
gilstate_cname
=
pyrex_prefix
+
"state"
skip_dispatch_cname
=
pyrex_prefix
+
"skip_dispatch"
empty_tuple
=
pyrex_prefix
+
"empty_tuple"
cleanup_cname
=
pyrex_prefix
+
"module_cleanup"
extern_c_macro
=
pyrex_prefix
.
upper
()
+
"EXTERN_C"
...
...
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