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
580cfa76
Commit
580cfa76
authored
Aug 09, 2008
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Py3/2.6 beta 2 have a public PyType_Modified() function
parent
17bf369b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
40 deletions
+2
-40
Cython/Compiler/ExprNodes.py
Cython/Compiler/ExprNodes.py
+1
-40
Cython/Compiler/ModuleNode.py
Cython/Compiler/ModuleNode.py
+1
-0
No files found.
Cython/Compiler/ExprNodes.py
View file @
580cfa76
...
...
@@ -870,8 +870,6 @@ class NameNode(AtomicExprNode):
env
.
control_flow
.
set_state
(
self
.
pos
,
(
self
.
name
,
'source'
),
'assignment'
)
if
self
.
entry
.
is_declared_generic
:
self
.
result_ctype
=
py_object_type
if
self
.
entry
.
is_pyglobal
and
self
.
entry
.
is_member
:
env
.
use_utility_code
(
type_cache_invalidation_code
)
def
analyse_types
(
self
,
env
):
if
self
.
entry
is
None
:
...
...
@@ -1025,7 +1023,7 @@ class NameNode(AtomicExprNode):
self
.
interned_cname
,
rhs
.
py_result
()))
# in Py2.6+, we need to invalidate the method cache
code
.
putln
(
"
__Pyx_Type
Modified(%s);"
%
code
.
putln
(
"
PyType_
Modified(%s);"
%
entry
.
scope
.
parent_type
.
typeptr_cname
)
else
:
code
.
put_error_if_neg
(
self
.
pos
,
...
...
@@ -4410,43 +4408,6 @@ static INLINE PyObject* __Pyx_PyObject_Append(PyObject* L, PyObject* x) {
#------------------------------------------------------------------------------------
type_cache_invalidation_code
=
[
"""
#if PY_VERSION_HEX >= 0x02060000
/* #define __Pyx_TypeModified(t) PyType_Modified(t) */ /* Py3.0beta1 */
static void __Pyx_TypeModified(PyTypeObject* type); /*proto*/
#else
#define __Pyx_TypeModified(t)
#endif
"""
,
"""
#if PY_VERSION_HEX >= 0x02060000
/* copied from typeobject.c in Python 3.0a5 */
static void __Pyx_TypeModified(PyTypeObject* type) {
PyObject *raw, *ref;
Py_ssize_t i, n;
if (!PyType_HasFeature(type, Py_TPFLAGS_VALID_VERSION_TAG))
return;
raw = type->tp_subclasses;
if (raw != NULL) {
n = PyList_GET_SIZE(raw);
for (i = 0; i < n; i++) {
ref = PyList_GET_ITEM(raw, i);
ref = PyWeakref_GET_OBJECT(ref);
if (ref != Py_None) {
__Pyx_TypeModified((PyTypeObject *)ref);
}
}
}
type->tp_flags &= ~Py_TPFLAGS_VALID_VERSION_TAG;
}
#endif
"""
]
#------------------------------------------------------------------------------------
# If the is_unsigned flag is set, we need to do some extra work to make
# sure the index doesn't become negative.
...
...
Cython/Compiler/ModuleNode.py
View file @
580cfa76
...
...
@@ -417,6 +417,7 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
code
.
putln
(
" #define Py_SIZE(ob) ((PyVarObject*)(ob))->ob_size)"
)
code
.
putln
(
" #define PyVarObject_HEAD_INIT(type, size)
\
\
"
)
code
.
putln
(
" PyObject_HEAD_INIT(type) size,"
)
code
.
putln
(
" #define PyType_Modified(t)"
)
code
.
putln
(
""
)
code
.
putln
(
" typedef struct {"
)
code
.
putln
(
" void *buf;"
)
...
...
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