lekma
491bbedc20
bpo-33391: Fix refleak in set_symmetric_difference (GH-6670)
8 years ago
Siddhesh Poyarekar
55edd0c185
bpo-33012: Fix invalid function cast warnings with gcc 8 for METH_NOARGS. (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.
8 years ago
Raymond Hettinger
fa78806041
Removed unnecesssary bit inversion which doesn't improve dispersion statistics ( #5235 )
8 years ago
Raymond Hettinger
b44c5169f6
bpo-26163: Frozenset hash improvement ( #5194 )
8 years ago
Raymond Hettinger
3329992e31
bpo-29476: Simplify set_add_entry() ( #5175 )
8 years ago
Serhiy Storchaka
13ad3b7a82
bpo-31462: Remove trailing whitespaces. ( #3564 )
8 years ago
Eric Snow
2ebc5ce42a
bpo-30860: Consolidate stateful runtime globals. ( #3397 )
* 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).
8 years ago
Eric Snow
05351c1bd8
Revert "bpo-30860: Consolidate stateful runtime globals." ( #3379 )
Windows buildbots started failing due to include-related errors.
8 years ago
Eric Snow
76d5abc868
bpo-30860: Consolidate stateful runtime globals. ( #2594 )
* 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).
8 years ago
Raymond Hettinger
64263dfd18
Fix terminology in comment and add more design rationale. ( #3335 )
* Fix terminology in comment and add more design rationale.
* Fix extra space
8 years ago
INADA Naoki
a6296d34a4
bpo-31095: fix potential crash during GC (GH-2974)
8 years ago
Serhiy Storchaka
6cca5c8459
bpo-30592: Fixed error messages for some builtins. ( #1996 )
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.
9 years ago
Serhiy Storchaka
bf623ae884
bpo-30061: Check if PyObject_Size()/PySequence_Size()/PyMapping_Size() ( #1096 )
raised an error.
Replace them with using concrete types API that never fails if appropriate.
9 years ago
INADA Naoki
e82cf8675b
bpo-29949: Fix set memory usage regression (GH-943)
Revert "Minor factoring: move redundant resize scaling logic into the resize function."
This reverts commit 4897300276 .
9 years ago
Serhiy Storchaka
68a001dd59
Issue #29460 : _PyArg_NoKeywords(), _PyArg_NoStackKeywords() and
_PyArg_NoPositional() now are macros.
9 years ago
Raymond Hettinger
5cd87a8d61
Reduce load factor (from 66% to 60%) to improve effectiveness of linear probing.
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).
9 years ago
Raymond Hettinger
e1af6964b4
Remove unnecessary variables.
* so->used never gets changed during a resize
* so->filled only changes when dummies are present and being eliminated
9 years ago
Serhiy Storchaka
5ab81d787f
Issue #28959 : Added private macro PyDict_GET_SIZE for retrieving the size of dict.
9 years ago
Serhiy Storchaka
85b0f5beb1
Added the const qualifier to char* variables that refer to readonly internal
UTF-8 represenatation of Unicode objects.
9 years ago
Serhiy Storchaka
06515833fe
Replaced outdated macros _PyUnicode_AsString and _PyUnicode_AsStringAndSize
with PyUnicode_AsUTF8 and PyUnicode_AsUTF8AndSize.
9 years ago
Raymond Hettinger
4103e4dfbc
Issue #28071 : Add early-out for differencing from an empty set.
9 years ago
Raymond Hettinger
8421d714d0
Removed unused initialization and the uninteresting comment.
10 years ago
Serhiy Storchaka
fa070298e9
Issue #26880 : Removed redundant checks in set.__init__.
10 years ago
Serhiy Storchaka
fbb1c5ee06
Issue #26494 : Fixed crash on iterating exhausting iterators.
Affected classes are generic sequence iterators, iterators of str, bytes,
bytearray, list, tuple, set, frozenset, dict, OrderedDict, corresponding
views and os.scandir() iterator.
10 years ago
Raymond Hettinger
3625af5f21
Moved misplaced functions to the section for C API functions.
10 years ago
Raymond Hettinger
2c257ab0f8
Responsibility for argument checking belongs in set.__init__() rather than 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.
10 years ago
Raymond Hettinger
b72e21b9ab
Speed-up construction of empty sets by approx 12-14%.
10 years ago
Raymond Hettinger
f50215412c
Add early-out for the common case where kwds is NULL (gives 1.1% speedup).
10 years ago
Benjamin Peterson
0e617e22f0
remove some copyright notices supserseded by the toplevel ones
10 years ago
Serhiy Storchaka
5c4064e8bd
Issue #25421 : __sizeof__ methods of builtin types now use dynamic basic size.
This allows sys.getsize() to work correctly with their subclasses with
__slots__ defined.
10 years ago
Raymond Hettinger
e4495877dd
Minor tweek. Counting down rather than up reduces register pressure.
10 years ago
Raymond Hettinger
86d322f020
Undo inadvertent line swap
10 years ago
Raymond Hettinger
5088f6005f
Hoist constant expressions (so->table and so->mask) out of the inner-loop.
10 years ago
Raymond Hettinger
66f6238fca
Add assertion to verify the pre-condition in the comments.
10 years ago
Raymond Hettinger
6019c8ced0
Issue #25629 : Move set fill/used updates out of inner loop
10 years ago
Raymond Hettinger
4148195c45
Move the active entry multiplication to later in the hash calculation
11 years ago
Raymond Hettinger
b501a27ad8
Restore frozenset hash caching removed in cf707dd190a9
11 years ago
Raymond Hettinger
a286a51ae1
Fix comment typo
11 years ago
Raymond Hettinger
36c0500990
Tweak the comments
11 years ago
Raymond Hettinger
fbffdef47d
Issue #24762 : Speed-up frozenset_hash() and greatly beef-up the comments.
11 years ago
Raymond Hettinger
daffc916aa
Issue #24681 : Move the most likely test first in set_add_entry().
11 years ago
Raymond Hettinger
70559b5c20
Issue #24681 : Move the store of so->table to the code block where it is used.
11 years ago
Raymond Hettinger
ff9e18a863
Issue #24583 : Consolidate previous set object updates into a single function
with a single entry point, named exit points at the bottom, more self-evident
refcount adjustments, and a comment describing why the pre-increment was
necessary at all.
11 years ago
Raymond Hettinger
482c05cbb5
Issue #24583 : Fix refcount leak.
11 years ago
Raymond Hettinger
061091a7c5
Issue #24583 : Fix crash when set is mutated while being updated.
11 years ago
Raymond Hettinger
a3626bc5bd
Issue #24583 : Fix crash when set is mutated while being updated.
11 years ago
Raymond Hettinger
5d2385ff6f
Neaten-up a little bit.
11 years ago
Raymond Hettinger
9632a7d735
Issue 24581: Revert c9782a9ac031 pending a stronger test for mutation during iteration.
11 years ago
Raymond Hettinger
11ce8e6c37
Minor bit of factoring-out common code.
11 years ago
Raymond Hettinger
3dbc11cadd
Tighten-up code in the set iterator to use an entry pointer rather than indexing.
11 years ago