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
5377ae79
Commit
5377ae79
authored
Dec 08, 2020
by
Robert Bradshaw
Committed by
GitHub
Dec 08, 2020
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3933 from vstinner/py_set_type
Use __Pyx_SET_SIZE() and __Pyx_SET_REFCNT()
parents
782a8733
5300b741
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
6 deletions
+6
-6
Cython/Utility/Coroutine.c
Cython/Utility/Coroutine.c
+2
-2
Cython/Utility/arrayarray.h
Cython/Utility/arrayarray.h
+4
-4
No files found.
Cython/Utility/Coroutine.c
View file @
5377ae79
...
...
@@ -1191,7 +1191,7 @@ static void __Pyx_Coroutine_del(PyObject *self) {
#if !CYTHON_USE_TP_FINALIZE
// Temporarily resurrect the object.
assert
(
self
->
ob_refcnt
==
0
);
self
->
ob_refcnt
=
1
;
__Pyx_SET_REFCNT
(
self
,
1
)
;
#endif
__Pyx_PyThreadState_assign
...
...
@@ -1283,7 +1283,7 @@ static void __Pyx_Coroutine_del(PyObject *self) {
{
Py_ssize_t
refcnt
=
self
->
ob_refcnt
;
_Py_NewReference
(
self
);
self
->
ob_refcnt
=
refcnt
;
__Pyx_SET_REFCNT
(
self
,
refcnt
)
;
}
#if CYTHON_COMPILING_IN_CPYTHON
assert
(
PyType_IS_GC
(
self
->
ob_type
)
&&
...
...
Cython/Utility/arrayarray.h
View file @
5377ae79
...
...
@@ -88,7 +88,7 @@ static CYTHON_INLINE PyObject * newarrayobject(PyTypeObject *type, Py_ssize_t si
op
->
ob_descr
=
descr
;
op
->
allocated
=
size
;
op
->
weakreflist
=
NULL
;
op
->
ob_size
=
size
;
__Pyx_SET_SIZE
(
op
,
size
)
;
if
(
size
<=
0
)
{
op
->
data
.
ob_item
=
NULL
;
}
...
...
@@ -116,7 +116,7 @@ static CYTHON_INLINE int resize(arrayobject *self, Py_ssize_t n) {
return
-
1
;
}
self
->
data
.
ob_item
=
(
char
*
)
items
;
self
->
ob_size
=
n
;
__Pyx_SET_SIZE
(
self
,
n
)
;
self
->
allocated
=
n
;
return
0
;
}
...
...
@@ -126,7 +126,7 @@ static CYTHON_INLINE int resize_smart(arrayobject *self, Py_ssize_t n) {
void
*
items
=
(
void
*
)
self
->
data
.
ob_item
;
Py_ssize_t
newsize
;
if
(
n
<
self
->
allocated
&&
n
*
4
>
self
->
allocated
)
{
self
->
ob_size
=
n
;
__Pyx_SET_SIZE
(
self
,
n
)
;
return
0
;
}
newsize
=
n
+
(
n
/
2
)
+
1
;
...
...
@@ -140,7 +140,7 @@ static CYTHON_INLINE int resize_smart(arrayobject *self, Py_ssize_t n) {
return
-
1
;
}
self
->
data
.
ob_item
=
(
char
*
)
items
;
self
->
ob_size
=
n
;
__Pyx_SET_SIZE
(
self
,
n
)
;
self
->
allocated
=
newsize
;
return
0
;
}
...
...
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