| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
Add new trashcan macros to deal with a double deallocation that could occur when the `tp_dealloc` of a subclass calls the `tp_dealloc` of a base class and that base class uses the trashcan mechanism.
Patch by Jeroen Demeyer.
|
|
|
|
|
|
|
|
| |
(GH-11047)
This speeds up pickling of some iterators.
This fixes also error handling in pickling methods when fail to
look up builtin "getattr".
|
|
|
|
| |
Move _PyObject_GC_TRACK() and _PyObject_GC_UNTRACK() from
Include/objimpl.h to Include/internal/pycore_object.h.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Rename Include/internal/ headers:
* pycore_hash.h -> pycore_pyhash.h
* pycore_lifecycle.h -> pycore_pylifecycle.h
* pycore_mem.h -> pycore_pymem.h
* pycore_state.h -> pycore_pystate.h
Add missing headers to Makefile.pre.in and PCbuild:
* pycore_condvar.h.
* pycore_hamt.h
* pycore_pyhash.h
|
|
|
| |
Remove unneeded assertion (we already know so is a PySetObject *).
|
|
|
|
|
| |
Gives approx 20% speed-up using clang depending on the number of elements in the set (the less dense the set, the more the speed-up).
Uses the same entry++ logic used elsewhere in the setobject.c code.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Rename Include/internal/ header files:
* pyatomic.h -> pycore_atomic.h
* ceval.h -> pycore_ceval.h
* condvar.h -> pycore_condvar.h
* context.h -> pycore_context.h
* pygetopt.h -> pycore_getopt.h
* gil.h -> pycore_gil.h
* hamt.h -> pycore_hamt.h
* hash.h -> pycore_hash.h
* mem.h -> pycore_mem.h
* pystate.h -> pycore_state.h
* warnings.h -> pycore_warnings.h
* PCbuild project, Makefile.pre.in, Modules/Setup: add the
Include/internal/ directory to the search paths of header files.
* Update includes. For example, replace #include "internal/mem.h"
with #include "pycore_mem.h".
|
|
|
|
| |
Simplify the pickling of set and dictionary objects iterators by consuming
the iterator into a list with PySequence_List.
|
|
|
|
|
|
|
|
| |
Address a C undefined behavior signed integer overflow issue in set object table resizing. Our -fwrapv compiler flag and practical reasons why sets are unlikely to get this large should mean this was never an issue but it was incorrect code that generates code analysis warnings.
<!-- issue-number: [bpo-1621](https://www.bugs.python.org/issue1621) -->
https://bugs.python.org/issue1621
<!-- /issue-number -->
|
| |
|
|
|
|
|
|
|
|
|
| |
(GH-6030)
METH_NOARGS functions need only a single argument but they are cast
into a PyCFunction, which takes two arguments. This triggers an
invalid function cast warning in gcc8 due to the argument mismatch.
Fix this by adding a dummy unused argument.
|
|
|
|
| |
statistics (#5235)
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
| |
* 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).
|
|
|
| |
Windows buildbots started failing due to include-related errors.
|
|
|
|
|
|
|
|
|
| |
* 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).
|
|
|
|
|
|
| |
* Fix terminology in comment and add more design rationale.
* Fix extra space
|
| |
|
|
|
|
|
| |
Error messages when pass keyword arguments to some builtins that
don't support keyword arguments contained double parenthesis: "()()".
The regression was introduced by bpo-30534.
|
|
|
|
|
|
| |
raised an error.
Replace them with using concrete types API that never fails if appropriate.
|
|
|
|
|
| |
Revert "Minor factoring: move redundant resize scaling logic into the resize function."
This reverts commit 4897300276d870f99459c82b937f0ac22450f0b6.
|
|
|
|
| |
_PyArg_NoPositional() now are macros.
|
|
|
|
|
|
|
| |
Decreased density gives better collision statistics (average of 2.5 probes in a
full table versus 3.0 previously) and fewer occurences of starting a second
possibly overlapping sequence of 10 linear probes. Makes resizes a little more
frequent but each with less work (fewer insertions and fewer collisions).
|
|
|
|
|
| |
* so->used never gets changed during a resize
* so->filled only changes when dummies are present and being eliminated
|
|
|
|
| |
dict.
|
|
|
|
| |
UTF-8 represenatation of Unicode objects.
|
|
|
|
| |
with PyUnicode_AsUTF8 and PyUnicode_AsUTF8AndSize.
|
| |
|
| |
|
| |
|
|\
| |
| |
| |
| |
| | |
Affected classes are generic sequence iterators, iterators of str, bytes,
bytearray, list, tuple, set, frozenset, dict, OrderedDict, corresponding
views and os.scandir() iterator.
|
| |
| |
| |
| |
| |
| | |
Affected classes are generic sequence iterators, iterators of str, bytes,
bytearray, list, tuple, set, frozenset, dict, OrderedDict, corresponding
views and os.scandir() iterator.
|
| | |
|
| |
| |
| |
| |
| |
| |
| | |
set.__new__().
See dict.__new__() and list.__new__() for comparison. Neither of those examine or touch
args or kwds. That work is done in the __init__() methods.
|
| | |
|
| | |
|
|\ \
| |/ |
|
| |\ |
|
| | |\ |
|
| | | | |
|
| | | | |
|
|\ \ \ \
| |/ / /
| | | |
| | | |
| | | | |
This allows sys.getsize() to work correctly with their subclasses with
__slots__ defined.
|
| | | |
| | | |
| | | |
| | | |
| | | | |
This allows sys.getsize() to work correctly with their subclasses with
__slots__ defined.
|
| | | | |
|
| | | | |
|
| | | | |
|
| | | | |
|
| | | | |
|