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
f3b71348
Commit
f3b71348
authored
Sep 15, 2017
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Avoid calling _PyDict_NewPresized() for len(dict) <=8, which is the minimum dict size in CPython.
parent
c132ad9c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
4 deletions
+4
-4
Cython/Utility/Coroutine.c
Cython/Utility/Coroutine.c
+1
-1
Cython/Utility/ModuleSetupCode.c
Cython/Utility/ModuleSetupCode.c
+1
-1
Cython/Utility/Printing.c
Cython/Utility/Printing.c
+2
-2
No files found.
Cython/Utility/Coroutine.c
View file @
f3b71348
...
@@ -1742,7 +1742,7 @@ static PyObject* __Pyx_Coroutine_patch_module(PyObject* module, const char* py_c
...
@@ -1742,7 +1742,7 @@ static PyObject* __Pyx_Coroutine_patch_module(PyObject* module, const char* py_c
#if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
#if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
int
result
;
int
result
;
PyObject
*
globals
,
*
result_obj
;
PyObject
*
globals
,
*
result_obj
;
globals
=
__Pyx_PyDict_NewPresized
(
4
);
if
(
unlikely
(
!
globals
))
goto
ignore
;
globals
=
PyDict_New
(
);
if
(
unlikely
(
!
globals
))
goto
ignore
;
result
=
PyDict_SetItemString
(
globals
,
"_cython_coroutine_type"
,
result
=
PyDict_SetItemString
(
globals
,
"_cython_coroutine_type"
,
#ifdef __Pyx_Coroutine_USED
#ifdef __Pyx_Coroutine_USED
(
PyObject
*
)
__pyx_CoroutineType
);
(
PyObject
*
)
__pyx_CoroutineType
);
...
...
Cython/Utility/ModuleSetupCode.c
View file @
f3b71348
...
@@ -256,7 +256,7 @@
...
@@ -256,7 +256,7 @@
#endif
#endif
#if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
#if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
#define __Pyx_PyDict_NewPresized(n)
_PyDict_NewPresized(n
)
#define __Pyx_PyDict_NewPresized(n)
((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)
)
#else
#else
#define __Pyx_PyDict_NewPresized(n) PyDict_New()
#define __Pyx_PyDict_NewPresized(n) PyDict_New()
#endif
#endif
...
...
Cython/Utility/Printing.c
View file @
f3b71348
...
@@ -83,7 +83,7 @@ static int __Pyx_Print(PyObject* stream, PyObject *arg_tuple, int newline) {
...
@@ -83,7 +83,7 @@ static int __Pyx_Print(PyObject* stream, PyObject *arg_tuple, int newline) {
return
-
1
;
return
-
1
;
}
}
if
(
stream
)
{
if
(
stream
)
{
kwargs
=
__Pyx_PyDict_NewPresized
(
2
);
kwargs
=
PyDict_New
(
);
if
(
unlikely
(
!
kwargs
))
if
(
unlikely
(
!
kwargs
))
return
-
1
;
return
-
1
;
if
(
unlikely
(
PyDict_SetItem
(
kwargs
,
PYIDENT
(
"file"
),
stream
)
<
0
))
if
(
unlikely
(
PyDict_SetItem
(
kwargs
,
PYIDENT
(
"file"
),
stream
)
<
0
))
...
@@ -100,7 +100,7 @@ static int __Pyx_Print(PyObject* stream, PyObject *arg_tuple, int newline) {
...
@@ -100,7 +100,7 @@ static int __Pyx_Print(PyObject* stream, PyObject *arg_tuple, int newline) {
}
}
}
else
if
(
!
newline
)
{
}
else
if
(
!
newline
)
{
if
(
unlikely
(
!
$
print_function_kwargs
))
{
if
(
unlikely
(
!
$
print_function_kwargs
))
{
$
print_function_kwargs
=
__Pyx_PyDict_NewPresized
(
1
);
$
print_function_kwargs
=
PyDict_New
(
);
if
(
unlikely
(
!
$
print_function_kwargs
))
if
(
unlikely
(
!
$
print_function_kwargs
))
return
-
1
;
return
-
1
;
end_string
=
PyUnicode_FromStringAndSize
(
" "
,
1
);
end_string
=
PyUnicode_FromStringAndSize
(
" "
,
1
);
...
...
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