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
Gwenaël Samain
cython
Commits
fcac9282
Commit
fcac9282
authored
Jan 18, 2009
by
Dag Sverre Seljebotn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refnanny: Disable in nogil functions
parent
f4e84e98
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
12 deletions
+23
-12
Cython/Compiler/Nodes.py
Cython/Compiler/Nodes.py
+13
-11
Cython/Runtime/build.sh
Cython/Runtime/build.sh
+2
-1
Cython/Runtime/refnanny.pyx
Cython/Runtime/refnanny.pyx
+8
-0
No files found.
Cython/Compiler/Nodes.py
View file @
fcac9282
...
@@ -1068,6 +1068,7 @@ class FuncDefNode(StatNode, BlockNode):
...
@@ -1068,6 +1068,7 @@ class FuncDefNode(StatNode, BlockNode):
# ----- Automatic lead-ins for certain special functions
# ----- Automatic lead-ins for certain special functions
if
is_getbuffer_slot
:
if
is_getbuffer_slot
:
self
.
getbuffer_init
(
code
)
self
.
getbuffer_init
(
code
)
if
not
lenv
.
nogil
:
code
.
put_setup_refcount_context
(
self
.
entry
.
name
)
code
.
put_setup_refcount_context
(
self
.
entry
.
name
)
# ----- Fetch arguments
# ----- Fetch arguments
self
.
generate_argument_parsing_code
(
env
,
code
)
self
.
generate_argument_parsing_code
(
env
,
code
)
...
@@ -1183,6 +1184,7 @@ class FuncDefNode(StatNode, BlockNode):
...
@@ -1183,6 +1184,7 @@ class FuncDefNode(StatNode, BlockNode):
# code.putln("/* TODO: decref scope object */")
# code.putln("/* TODO: decref scope object */")
# ----- Return
# ----- Return
# This code is duplicated in ModuleNode.generate_module_init_func
# This code is duplicated in ModuleNode.generate_module_init_func
if
not
lenv
.
nogil
:
default_retval
=
self
.
return_type
.
default_value
default_retval
=
self
.
return_type
.
default_value
err_val
=
self
.
error_value
()
err_val
=
self
.
error_value
()
if
err_val
is
None
and
default_retval
:
if
err_val
is
None
and
default_retval
:
...
...
Cython/Runtime/build.sh
View file @
fcac9282
# Temporary hacky script, should be replaced
# Temporary hacky script, should be replaced
# with distutils-based solution.
# with distutils-based solution.
PYTHONINC
=
/local/include/python2.5
#PYTHONINC=/local/include/python2.5
PYTHONINC
=
/usr/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
\
...
...
Cython/Runtime/refnanny.pyx
View file @
fcac9282
from
python_ref
cimport
Py_INCREF
,
Py_DECREF
from
python_ref
cimport
Py_INCREF
,
Py_DECREF
cimport
python_exc
as
exc
loglevel
=
0
loglevel
=
0
reflog
=
[]
reflog
=
[]
...
@@ -69,6 +71,12 @@ cdef public void __Pyx_Refnanny_DECREF(void* ctx, object obj, int lineno):
...
@@ -69,6 +71,12 @@ cdef public void __Pyx_Refnanny_DECREF(void* ctx, object obj, int lineno):
Py_DECREF
(
obj
)
Py_DECREF
(
obj
)
cdef
public
int
__Pyx_Refnanny_FinishContext
(
void
*
ctx
)
except
-
1
:
cdef
public
int
__Pyx_Refnanny_FinishContext
(
void
*
ctx
)
except
-
1
:
cdef
exc
.
PyObject
*
type
,
*
value
,
*
tb
if
exc
.
PyErr_Occurred
():
exc
.
PyErr_Fetch
(
&
type
,
&
value
,
&
tb
)
Py_DECREF
(
<
object
>
type
);
Py_DECREF
(
<
object
>
value
);
Py_DECREF
(
<
object
>
tb
)
print
"cleared!"
print
(
exc
.
PyErr_Occurred
()
==
NULL
)
obj
=
<
object
>
ctx
obj
=
<
object
>
ctx
try
:
try
:
obj
.
end
()
obj
.
end
()
...
...
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