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
7c52c8a9
Commit
7c52c8a9
authored
Jan 07, 2009
by
Dag Sverre Seljebotn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refnanny cleanup and bugfix.
parent
f4cb6c7b
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
22 deletions
+9
-22
Cython/Compiler/Code.py
Cython/Compiler/Code.py
+3
-0
Cython/Compiler/ModuleNode.py
Cython/Compiler/ModuleNode.py
+1
-5
Cython/Compiler/Nodes.py
Cython/Compiler/Nodes.py
+1
-1
Cython/Runtime/build.sh
Cython/Runtime/build.sh
+4
-16
No files found.
Cython/Compiler/Code.py
View file @
7c52c8a9
...
@@ -744,6 +744,9 @@ class CCodeWriter(object):
...
@@ -744,6 +744,9 @@ class CCodeWriter(object):
def
put_giveref
(
self
,
cname
):
def
put_giveref
(
self
,
cname
):
self
.
putln
(
"__Pyx_GIVEREF(%s);"
%
cname
)
self
.
putln
(
"__Pyx_GIVEREF(%s);"
%
cname
)
def
put_xgiveref
(
self
,
cname
):
self
.
putln
(
"__Pyx_XGIVEREF(%s);"
%
cname
)
def
put_incref
(
self
,
cname
,
type
):
def
put_incref
(
self
,
cname
,
type
):
self
.
putln
(
"__Pyx_INCREF(%s);"
%
self
.
as_pyobject
(
cname
,
type
))
self
.
putln
(
"__Pyx_INCREF(%s);"
%
self
.
as_pyobject
(
cname
,
type
))
...
...
Cython/Compiler/ModuleNode.py
View file @
7c52c8a9
...
@@ -2321,7 +2321,6 @@ bad:
...
@@ -2321,7 +2321,6 @@ bad:
refcount_utility_code
=
UtilityCode
(
proto
=
"""
refcount_utility_code
=
UtilityCode
(
proto
=
"""
#ifdef CYTHON_REFNANNY
#ifdef CYTHON_REFNANNY
void __Pyx_Refnanny_INCREF(void*, PyObject*, int);
void __Pyx_Refnanny_INCREF(void*, PyObject*, int);
void __Pyx_Refnanny_GOTREF(void*, PyObject*, int);
void __Pyx_Refnanny_GOTREF(void*, PyObject*, int);
void __Pyx_Refnanny_GIVEREF(void*, PyObject*, int);
void __Pyx_Refnanny_GIVEREF(void*, PyObject*, int);
...
@@ -2329,7 +2328,6 @@ void __Pyx_Refnanny_INCREF(void*, PyObject*, int);
...
@@ -2329,7 +2328,6 @@ void __Pyx_Refnanny_INCREF(void*, PyObject*, int);
void __Pyx_Refnanny_DECREF(void*, PyObject*, int);
void __Pyx_Refnanny_DECREF(void*, PyObject*, int);
void* __Pyx_Refnanny_NewContext(char*, int);
void* __Pyx_Refnanny_NewContext(char*, int);
int __Pyx_Refnanny_FinishContext(void*);
int __Pyx_Refnanny_FinishContext(void*);
#define __Pyx_INCREF(r) __Pyx_Refnanny_INCREF(__pyx_refchk, r, __LINE__)
#define __Pyx_INCREF(r) __Pyx_Refnanny_INCREF(__pyx_refchk, r, __LINE__)
#define __Pyx_GOTREF(r) __Pyx_Refnanny_GOTREF(__pyx_refchk, r, __LINE__)
#define __Pyx_GOTREF(r) __Pyx_Refnanny_GOTREF(__pyx_refchk, r, __LINE__)
#define __Pyx_GIVEREF(r) __Pyx_Refnanny_GIVEREF(__pyx_refchk, r, __LINE__)
#define __Pyx_GIVEREF(r) __Pyx_Refnanny_GIVEREF(__pyx_refchk, r, __LINE__)
...
@@ -2338,9 +2336,7 @@ int __Pyx_Refnanny_FinishContext(void*);
...
@@ -2338,9 +2336,7 @@ int __Pyx_Refnanny_FinishContext(void*);
#define __Pyx_SetupRefcountContext(name)
\
#define __Pyx_SetupRefcountContext(name)
\
void* __pyx_refchk = __Pyx_Refnanny_NewContext(name, __LINE__)
void* __pyx_refchk = __Pyx_Refnanny_NewContext(name, __LINE__)
#define __Pyx_FinishRefcountContext() __Pyx_Refnanny_FinishContext(__pyx_refchk)
#define __Pyx_FinishRefcountContext() __Pyx_Refnanny_FinishContext(__pyx_refchk)
#else
#else
#define __Pyx_INCREF(r) Py_INCREF(r)
#define __Pyx_INCREF(r) Py_INCREF(r)
#define __Pyx_GOTREF(r)
#define __Pyx_GOTREF(r)
#define __Pyx_GIVEREF(r)
#define __Pyx_GIVEREF(r)
...
@@ -2348,6 +2344,6 @@ int __Pyx_Refnanny_FinishContext(void*);
...
@@ -2348,6 +2344,6 @@ int __Pyx_Refnanny_FinishContext(void*);
#define __Pyx_XDECREF(r) Py_XDECREF(r)
#define __Pyx_XDECREF(r) Py_XDECREF(r)
#define __Pyx_SetupRefcountContext(name)
#define __Pyx_SetupRefcountContext(name)
#define __Pyx_FinishRefcountContext() 0
#define __Pyx_FinishRefcountContext() 0
#endif /* CYTHON_REFNANNY */
#endif /* CYTHON_REFNANNY */
#define __Pyx_XGIVEREF(r) (r ? __Pyx_GIVEREF(r) : 0)
"""
)
"""
)
Cython/Compiler/Nodes.py
View file @
7c52c8a9
...
@@ -1142,7 +1142,7 @@ class FuncDefNode(StatNode, BlockNode):
...
@@ -1142,7 +1142,7 @@ class FuncDefNode(StatNode, BlockNode):
if
err_val
is
None
and
default_retval
:
if
err_val
is
None
and
default_retval
:
err_val
=
default_retval
err_val
=
default_retval
if
self
.
return_type
.
is_pyobject
:
if
self
.
return_type
.
is_pyobject
:
code
.
put_giveref
(
Naming
.
retval_cname
)
code
.
put_
x
giveref
(
Naming
.
retval_cname
)
if
err_val
is
None
:
if
err_val
is
None
:
code
.
putln
(
'__Pyx_FinishRefcountContext();'
)
code
.
putln
(
'__Pyx_FinishRefcountContext();'
)
else
:
else
:
...
...
Cython/Runtime/build.sh
View file @
7c52c8a9
cat
<<
EOF
> ../../Cython/Compiler/DebugFlags.py
# Temporary hacky script, should be replaced
debug_disposal_code = 0
# with distutils-based solution.
debug_temp_alloc = 0
debug_coercion = 0
debug_refnanny = 0
EOF
PYTHONINC
=
/local/include/python2.5
python ../../cython.py refnanny.pyx
python ../../cython.py refnanny.pyx
gcc
-shared
-pthread
-fPIC
-fwrapv
-O2
-Wall
\
gcc
-shared
-pthread
-fPIC
-fwrapv
-O2
-Wall
\
-fno-strict-aliasing
-I
/local/include/python2.5
\
-fno-strict-aliasing
-I
$PYTHONINC
\
-o
refnanny.so
-I
.
refnanny.c
-o
refnanny.so
-I
.
refnanny.c
cat
<<
EOF
> ../../Cython/Compiler/DebugFlags.py
debug_disposal_code = 0
debug_temp_alloc = 0
debug_coercion = 0
debug_refnanny = 1
EOF
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