Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
988e6aa3
Commit
988e6aa3
authored
Jun 18, 2019
by
Jeroen Demeyer
Committed by
Inada Naoki
Jun 18, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bpo-37233: use _PY_FASTCALL_SMALL_STACK in method_vectorcall (GH-13974)
parent
c78fe320
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
5 deletions
+13
-5
Objects/classobject.c
Objects/classobject.c
+13
-5
No files found.
Objects/classobject.c
View file @
988e6aa3
...
...
@@ -64,11 +64,17 @@ method_vectorcall(PyObject *method, PyObject *const *args,
Py_ssize_t
nkwargs
=
(
kwnames
==
NULL
)
?
0
:
PyTuple_GET_SIZE
(
kwnames
);
PyObject
**
newargs
;
Py_ssize_t
totalargs
=
nargs
+
nkwargs
;
PyObject
*
newargs_stack
[
_PY_FASTCALL_SMALL_STACK
];
if
(
totalargs
<=
(
Py_ssize_t
)
Py_ARRAY_LENGTH
(
newargs_stack
)
-
1
)
{
newargs
=
newargs_stack
;
}
else
{
newargs
=
PyMem_Malloc
((
totalargs
+
1
)
*
sizeof
(
PyObject
*
));
if
(
newargs
==
NULL
)
{
PyErr_NoMemory
();
return
NULL
;
}
}
/* use borrowed references */
newargs
[
0
]
=
self
;
if
(
totalargs
)
{
/* bpo-37138: if totalargs == 0, then args may be
...
...
@@ -77,8 +83,10 @@ method_vectorcall(PyObject *method, PyObject *const *args,
memcpy
(
newargs
+
1
,
args
,
totalargs
*
sizeof
(
PyObject
*
));
}
result
=
_PyObject_Vectorcall
(
func
,
newargs
,
nargs
+
1
,
kwnames
);
if
(
newargs
!=
newargs_stack
)
{
PyMem_Free
(
newargs
);
}
}
return
result
;
}
...
...
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