| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
| |
Fix typos found by codespell in docs, docstrings, and comments.
|
|
|
|
|
| |
(GH-5222)
Add two new private APIs: _PyObject_LookupAttr() and _PyObject_LookupAttrId()
|
| |
|
|
|
|
|
|
| |
PyMemoryView_FromMemory() created a memoryview referring to
the internal data of the string. When the string is destroyed
the memoryview become referring to a freed memory.
|
|
|
|
|
|
|
| |
when serialize into memory buffer with C pickle implementations.
This optimization already is performed when serialize into memory
with Python pickle implementations or into a file with both
implementations.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The picklers do no longer allocate temporary memory when dumping large
bytes and str objects into a file object. Instead the data is
directly streamed into the underlying file object.
Previously the C implementation would buffer all content and issue a
single call to file.write() at the end of the dump. With protocol 4
this behavior has changed to issue one call to file.write() per frame.
The Python pickler with protocol 4 now dumps each frame content as a
memoryview to an IOBytes instance that is never reused and the
memoryview is no longer released after the call to write. This makes it
possible for the file object to delay access to the memoryview of
previous frames without forcing any additional memory copy as was
already possible with the C pickler.
|
|
|
|
| |
with the persistent_id() and persistent_load() methods.
|
| |
|
|
|
|
| |
(#4384)
|
| |
|
|
|
|
|
| |
The concrete PyDict_* API is used to interact with PyInterpreterState.modules in a number of places. This isn't compatible with all dict subclasses, nor with other Mapping implementations. This patch switches the concrete API usage to the corresponding abstract API calls.
We also add a PyImport_GetModule() function (and some other helpers) to reduce a bunch of code duplication.
|
|
|
|
|
|
|
| |
* Add Py_UNREACHABLE() as an alias to abort().
* Use Py_UNREACHABLE() instead of assert(0)
* Convert more unreachable code to use Py_UNREACHABLE()
* Document Py_UNREACHABLE() and a few other macros.
|
|
|
| |
PR #1638, for bpo-28411, causes problems in some (very) edge cases. Until that gets sorted out, we're reverting the merge. PR #3506, a fix on top of #1638, is also getting reverted.
|
|
|
| |
PR #3397 introduced a large number of warnings to the Windows build. This patch fixes them.
|
|
|
|
|
|
|
| |
* group the (stateful) runtime globals into various topical structs
* consolidate the topical structs under a single top-level _PyRuntimeState struct
* add a check-c-globals.py script that helps identify runtime globals
Other globals are excluded (see globals.txt and check-c-globals.py).
|
|
|
|
|
|
| |
_PyUnicode_FromId() can return NULL: replace Py_INCREF() with
Py_XINCREF().
Fix coverity report: CID 1417269.
|
|
|
| |
sys.modules is the one true source.
|
|
|
|
| |
(#748)
|
|
|
|
|
| |
_Pickle_FastCall() has a surprising API: it decrements the reference counter of
its second argument.
|
|
|
|
|
| |
method when unpickle collections.deque and other list-like objects.
This can speed up unpickling to 2 times.
|
|\ |
|
| |\ |
|
| | | |
|
| | |
| | |
| | |
| | | |
dict.
|
| | |
| | |
| | |
| | |
| | | |
Warnings seen on the "AMD64 Debian PGO 3.x" buildbot. Warnings are false
positive, but variable initialization should not harm performances.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Issue #28915: Replace _PyObject_CallMethodId() with
_PyObject_CallMethodIdObjArgs() in various modules when the format string was
only made of "O" formats, PyObject* arguments.
_PyObject_CallMethodIdObjArgs() avoids the creation of a temporary tuple and
doesn't have to parse a format string.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Replace
_PyObject_CallArg1(func, arg)
with
PyObject_CallFunctionObjArgs(func, arg, NULL)
Using the _PyObject_CallArg1() macro increases the usage of the C stack, which
was unexpected and unwanted. PyObject_CallFunctionObjArgs() doesn't have this
issue.
|
|/ /
| |
| |
| | |
UTF-8 represenatation of Unicode objects.
|
| |
| |
| |
| | |
with PyUnicode_AsUTF8 and PyUnicode_AsUTF8AndSize.
|
|\ \
| |/
| |
| |
| |
| | |
_PyUnicode_EqualToASCIIString.
The latter function is more readable, faster and doesn't raise exceptions.
|
| |
| |
| |
| |
| |
| | |
_PyUnicode_EqualToASCIIString.
The latter function is more readable, faster and doesn't raise exceptions.
|
| |
| |
| |
| |
| | |
C implementation of unpickler. UnpicklingError is now raised instead of
AttributeError and ValueError in some cases.
|
| |
| |
| |
| |
| |
| | |
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.
|
| | |
|
| |
| |
| |
| |
| |
| |
| | |
_Pickle_FastCall() is now fast again!
The optimization was introduced in Python 3.2, removed in Python 3.4 and
reintroduced in Python 3.6 (thanks to the new generic fastcall functions).
|
| |
| |
| |
| |
| |
| |
| |
| | |
Issue #27809:
* Rename _PyObject_FastCall() function to _PyObject_FastCallDict()
* Add _PyObject_FastCall(), _PyObject_CallNoArg() and _PyObject_CallArg1()
macros calling _PyObject_FastCallDict()
|
| |
| |
| |
| | |
Use _PyObject_FastCall() to avoid the creation of temporary tuple.
|
|\ \
| |/
| |
| | |
Original patch by Alexandre Vassalotti.
|
| |
| |
| |
| | |
Original patch by Alexandre Vassalotti.
|
|\ \
| |/
| |
| | |
generated by Argument Clinic. Patch by Petr Viktorin.
|
| |
| |
| |
| | |
generated by Argument Clinic. Patch by Petr Viktorin.
|
|\ \
| |/ |
|
| | |
|
|\ \
| |/ |
|
| |
| |
| |
| | |
Most fixes to Doc/ and Lib/ directories by Ville Skyttä.
|
| | |
|
| |
| |
| |
| |
| | |
Issue #27056: Optimize pickle.load() and pickle.loads(), up to 10% faster to
deserialize a lot of small objects.
|
|\ \
| |/
| |
| | |
messages.
|
| | |
|
|\ \
| |/ |
|