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
28385b16
Commit
28385b16
authored
Feb 03, 2009
by
Lisandro Dalcin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove those 'Refnanny' prefixes in refnanny.pyx
parent
df2ad2f0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
18 deletions
+18
-18
Cython/Runtime/refnanny.pyx
Cython/Runtime/refnanny.pyx
+18
-18
No files found.
Cython/Runtime/refnanny.pyx
View file @
28385b16
...
...
@@ -11,10 +11,10 @@ cdef log(level, action, obj, lineno):
LOG_NONE
,
LOG_ALL
=
range
(
2
)
class
RefnannyException
(
Exception
):
class
Error
(
Exception
):
pass
class
Refnanny
Context
(
object
):
class
Context
(
object
):
def
__init__
(
self
):
self
.
refs
=
{}
# id -> (count, [lineno])
self
.
errors
=
[]
...
...
@@ -52,17 +52,17 @@ class RefnannyContext(object):
self
.
errors
.
append
(
"References leaked: %s"
%
msg
)
if
self
.
errors
:
# print self.errors
raise
RefnannyException
(
"
\
n
"
.
join
(
self
.
errors
))
raise
Error
(
"
\
n
"
.
join
(
self
.
errors
))
cdef
void
*
Refnanny_
NewContext
(
char
*
funcname
,
int
lineno
)
except
NULL
:
cdef
void
*
NewContext
(
char
*
funcname
,
int
lineno
)
except
NULL
:
if
exc
.
PyErr_Occurred
()
!=
NULL
:
print
"error flag set on newcontext?"
return
NULL
ctx
=
Refnanny
Context
()
ctx
=
Context
()
Py_INCREF
(
ctx
)
return
<
void
*>
ctx
cdef
void
Refnanny_
GOTREF
(
void
*
ctx
,
void
*
p_obj
,
int
lineno
):
cdef
void
GOTREF
(
void
*
ctx
,
void
*
p_obj
,
int
lineno
):
cdef
exc
.
PyObject
*
type
=
NULL
,
*
value
=
NULL
,
*
tb
=
NULL
if
ctx
==
NULL
:
return
exc
.
PyErr_Fetch
(
&
type
,
&
value
,
&
tb
)
...
...
@@ -78,7 +78,7 @@ cdef void Refnanny_GOTREF(void* ctx, void* p_obj, int lineno):
Py_XDECREF
(
<
object
>
tb
)
raise
cdef
void
Refnanny_
GIVEREF
(
void
*
ctx
,
void
*
p_obj
,
int
lineno
):
cdef
void
GIVEREF
(
void
*
ctx
,
void
*
p_obj
,
int
lineno
):
cdef
exc
.
PyObject
*
type
=
NULL
,
*
value
=
NULL
,
*
tb
=
NULL
if
ctx
==
NULL
:
return
exc
.
PyErr_Fetch
(
&
type
,
&
value
,
&
tb
)
...
...
@@ -94,16 +94,16 @@ cdef void Refnanny_GIVEREF(void* ctx, void* p_obj, int lineno):
Py_XDECREF
(
<
object
>
tb
)
raise
cdef
void
Refnanny_
INCREF
(
void
*
ctx
,
void
*
obj
,
int
lineno
):
cdef
void
INCREF
(
void
*
ctx
,
void
*
obj
,
int
lineno
):
if
obj
is
not
NULL
:
Py_INCREF
(
<
object
>
obj
)
Refnanny_
GOTREF
(
ctx
,
obj
,
lineno
)
GOTREF
(
ctx
,
obj
,
lineno
)
cdef
void
Refnanny_
DECREF
(
void
*
ctx
,
void
*
obj
,
int
lineno
):
cdef
void
DECREF
(
void
*
ctx
,
void
*
obj
,
int
lineno
):
# GIVEREF raises exception if we hit 0
Refnanny_
GIVEREF
(
ctx
,
obj
,
lineno
)
GIVEREF
(
ctx
,
obj
,
lineno
)
if
obj
is
not
NULL
:
Py_DECREF
(
<
object
>
obj
)
cdef
int
Refnanny_
FinishContext
(
void
*
ctx
)
except
-
1
:
cdef
int
FinishContext
(
void
*
ctx
)
except
-
1
:
cdef
exc
.
PyObject
*
type
=
NULL
,
*
value
=
NULL
,
*
tb
=
NULL
if
ctx
==
NULL
:
assert
False
...
...
@@ -136,11 +136,11 @@ ctypedef struct RefnannyAPIStruct:
int
(
*
FinishContext
)(
void
*
)
except
-
1
cdef
RefnannyAPIStruct
api
api
.
INCREF
=
Refnanny_
INCREF
api
.
DECREF
=
Refnanny_
DECREF
api
.
GOTREF
=
Refnanny_
GOTREF
api
.
GIVEREF
=
Refnanny_
GIVEREF
api
.
NewContext
=
Refnanny_
NewContext
api
.
FinishContext
=
Refnanny_
FinishContext
api
.
INCREF
=
INCREF
api
.
DECREF
=
DECREF
api
.
GOTREF
=
GOTREF
api
.
GIVEREF
=
GIVEREF
api
.
NewContext
=
NewContext
api
.
FinishContext
=
FinishContext
RefnannyAPI
=
PyCObject_FromVoidPtr
(
&
api
,
NULL
)
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