| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| | | | |
|
| | | |
| | | |
| | | |
| | | | |
Directly pass NULL rather than an empty string.
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Don't pass "()" format to PyObject_CallXXX() to call a function without
argument: pass NULL as the format string instead. It avoids to have to parse a
string to produce 0 argument.
|
| | | | |
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Other changes:
* Rewrite _Py_normalize_encoding() as a C implementation of
encodings.normalize_encoding(). For example, " utf-8 " is now normalized to
"utf_8". So the fast path is now used for more name variants of the same
encoding.
* Avoid strcpy() when encoding is NULL: call directly the UTF-8 codec
|
| | | | |
|
| | | | |
|
| | | |
| | | |
| | | |
| | | | |
I forgot to remove this function, I made a mistake in my revert.
|
|\ \ \ \
| |/ / / |
|
| | | |
| | | |
| | | |
| | | | |
Patch from Armin Rigo.
|
|\ \ \ \
| |/ / / |
|
| | | |
| | | |
| | | |
| | | | |
Patch from Armin Rigo.
|
| | | |
| | | |
| | | |
| | | | |
module. Original patch by Eli Stevens.
|
| | | |
| | | |
| | | |
| | | | |
Add also a newline for readability in normalize_encoding().
|
| | | | |
|
| | | |
| | | |
| | | |
| | | | |
allocate large amounts of memory.
|
| | | |
| | | |
| | | |
| | | | |
storage requirements and relax restriction on converting large integers. Patch by Serhiy Storchaka.
|
| | | |
| | | |
| | | |
| | | | |
long_invert. Thanks Oren Milman.
|
| | | |
| | | |
| | | |
| | | | |
Patch by Xiang Zhang.
|
|\ \ \ \
| |/ / / |
|
| | | | |
|
| | | | |
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Issue #27841: Add _PyObject_Call_Prepend() helper function to prepend an
argument to existing arguments to call a function. This helper uses fast calls.
Modify method_call() and slot_tp_new() to use _PyObject_Call_Prepend().
|
| | | |
| | | |
| | | |
| | | | |
Pass stack, not unrelated and uninitialized args!
|
| | | |
| | | |
| | | |
| | | |
| | | | |
_PyObject_FastCallDict() only requires _Py_CheckFunctionResult() for the
slow-path. Other cases already check for the result.
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Issue #27830: Similar to _PyObject_FastCallDict(), but keyword arguments are
also passed in the same C array than positional arguments, rather than being
passed as a Python dict.
|
| | | |
| | | |
| | | |
| | | |
| | | | |
Issue #27848: use Py_ssize_t rather than C int for the number of function
positional and keyword arguments.
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Issue #27809:
* PyObject_CallMethodObjArgs(), _PyObject_CallMethodIdObjArgs() and
PyObject_CallFunctionObjArgs() now use fast call to avoid the creation of a
temporary tuple
* Rename objargs_mktuple() to objargs_mkstack()
* objargs_mkstack() now stores objects in a C array using borrowed references,
instead of storing arguments into a tuple
objargs_mkstack() uses a small buffer allocated on the C stack for 5 arguments
or less, or allocates a buffer in the heap memory.
Note: this change is different than the change 0e4f26083bbb, I fixed the test
to decide if the small stack can be used or not. sizeof(PyObject**) was also
replaced with sizeof(stack[0]) since the sizeof() was wrong (but gave the same
result).
|
| | | | |
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Issue #27809:
* PyObject_CallMethodObjArgs(), _PyObject_CallMethodIdObjArgs() and
PyObject_CallFunctionObjArgs() now use fast call to avoid the creation of a
temporary tuple
* Rename objargs_mktuple() to objargs_mkstack()
* objargs_mkstack() now stores objects in a C array using borrowed references,
instead of storing arguments into a tuple
objargs_mkstack() uses a small buffer allocated on the C stack for 5 arguments
or less, or allocates a buffer in the heap memory.
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Modify:
* init_subclass()
* builtin___build_class__()
Fix also a bug in init_subclass(): check for super() failure.
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Modify:
* builtin_sorted()
* classmethoddescr_call()
* methoddescr_call()
* wrapperdescr_call()
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Issue #27809:
* Rename _PyFunction_FastCall() to _PyFunction_FastCallDict()
* Rename _PyCFunction_FastCall() to _PyCFunction_FastCallDict()
* _PyFunction_FastCallDict() now supports keyword arguments
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Issue #27809:
* Rename _PyObject_FastCall() function to _PyObject_FastCallDict()
* Add _PyObject_FastCall(), _PyObject_CallNoArg() and _PyObject_CallArg1()
macros calling _PyObject_FastCallDict()
|
| | | | |
|
| | | | |
|
| | | | |
|
| | | |
| | | |
| | | |
| | | | |
have caused off-by-one-ulp results on certain platforms.
|
| | | |
| | | |
| | | |
| | | | |
by Xiang Zhang.
|
|\ \ \ \
| |/ / / |
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Multi-phase extension module import now correctly allows the
``m_methods`` field to be used to add module level functions
to instances of non-module types returned from ``Py_create_mod``.
Patch by Xiang Zhang.
|
| | | |
| | | |
| | | |
| | | | |
Patch by Xiang Zhang.
|
| | | |
| | | |
| | | |
| | | | |
Handle PyTuple_New(0) failure.
|
| | | |
| | | |
| | | |
| | | |
| | | | |
Issue #27128: PyFile_WriteObject() now calls _PyObject_FastCall() to avoid the
creation of a temporary tuple.
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Issue #27128: calliter_iternext() now calls _PyObject_FastCall() to avoid a
temporary empty tuple.
Cleanup also the code to reduce the indentation level.
|
| | | |
| | | |
| | | |
| | | |
| | | | |
Issue #27128: slot_tp_iter() now calls _PyObject_FastCall() to avoid a
temporary empty tuple.
|
| | | |
| | | |
| | | |
| | | |
| | | | |
Issue #27128: slot_nb_bool() now calls _PyObject_FastCall() to avoid a
temporary empty tuple to call the slot function.
|
| | | |
| | | |
| | | |
| | | | |
Use an error label to reduce the level of indentation.
|
| | | |
| | | |
| | | |
| | | |
| | | | |
slot_sq_item() now calls _PyObject_FastCall() to avoid the creation of a
temporary tuple of 1 item to pass the 'item' argument to the slot function.
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
* Invert condition of test to avoid levels of indentation
* Remove useless Py_XDECREF(args) in the error block
* Replace Py_XDECREF(func) with Py_DECREF(func) in the error block: func cannot
be NULL when reaching the error block
|