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
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
cython
Commits
8c58fa41
Commit
8c58fa41
authored
Dec 11, 2010
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
split refnanny setup macro in declaration and setup part
parent
36056016
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
1 deletion
+9
-1
Cython/Compiler/Code.py
Cython/Compiler/Code.py
+4
-0
Cython/Compiler/ModuleNode.py
Cython/Compiler/ModuleNode.py
+3
-1
Cython/Compiler/Nodes.py
Cython/Compiler/Nodes.py
+2
-0
No files found.
Cython/Compiler/Code.py
View file @
8c58fa41
...
...
@@ -475,6 +475,7 @@ class GlobalState(object):
w.enter_cfunc_scope()
w.putln("")
w.putln("
static
int
__Pyx_InitCachedConstants
(
void
)
{
")
w.put_declare_refcount_context()
w.put_setup_refcount_context("
__Pyx_InitCachedConstants
")
w = self.parts['init_globals']
...
...
@@ -1344,6 +1345,9 @@ class CCodeWriter(object):
def
lookup_filename
(
self
,
filename
):
return
self
.
globalstate
.
lookup_filename
(
filename
)
def
put_declare_refcount_context
(
self
):
self
.
putln
(
'__Pyx_RefNannyDeclareContext'
)
def
put_setup_refcount_context
(
self
,
name
):
self
.
putln
(
'__Pyx_RefNannySetupContext("%s");'
%
name
)
...
...
Cython/Compiler/ModuleNode.py
View file @
8c58fa41
...
...
@@ -2575,8 +2575,9 @@ refnanny_utility_code = UtilityCode(proto="""
Py_XDECREF(m);
return (__Pyx_RefNannyAPIStruct *)r;
}
#define __Pyx_RefNannyDeclareContext void *__pyx_refnanny;
#define __Pyx_RefNannySetupContext(name)
\
void *
__pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
__pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
#define __Pyx_RefNannyFinishContext()
\
__Pyx_RefNanny->FinishContext(&__pyx_refnanny)
#define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
...
...
@@ -2585,6 +2586,7 @@ refnanny_utility_code = UtilityCode(proto="""
#define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
#define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r);} } while(0)
#else
#define __Pyx_RefNannyDeclareContext
#define __Pyx_RefNannySetupContext(name)
#define __Pyx_RefNannyFinishContext()
#define __Pyx_INCREF(r) Py_INCREF(r)
...
...
Cython/Compiler/Nodes.py
View file @
8c58fa41
...
...
@@ -1296,6 +1296,7 @@ class FuncDefNode(StatNode, BlockNode):
(
self
.
return_type
.
declaration_code
(
Naming
.
retval_cname
),
init
))
tempvardecl_code
=
code
.
insertion_point
()
code
.
put_declare_refcount_context
()
if
not
self
.
is_generator
:
self
.
generate_keyword_list
(
code
)
if
profile
:
...
...
@@ -1918,6 +1919,7 @@ class GeneratorWrapperNode(object):
code
.
enter_cfunc_scope
()
code
.
putln
()
code
.
putln
(
'%s {'
%
self
.
header
)
code
.
put_declare_refcount_context
()
self
.
def_node
.
generate_keyword_list
(
code
)
code
.
put
(
lenv
.
scope_class
.
type
.
declaration_code
(
Naming
.
cur_scope_cname
))
code
.
putln
(
";"
)
...
...
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