summaryrefslogtreecommitdiffstats
path: root/Objects/dictobject.c
Commit message (Collapse)AuthorAgeFilesLines
* Fix a memory leak in split-table dictionariesVictor Stinner2016-12-151-5/+22
| | | | | | | | Issue #28147: Fix a memory leak in split-table dictionaries: setattr() must not convert combined table into split table. Patch written by INADA Naoki. (grafted from 85be9dcc16a81d3ccd1f67b056255a7f206edd47)
* Issue #28123: _PyDict_GetItem_KnownHash() now can raise an exception asSerhiy Storchaka2016-11-061-26/+22
| | | | PyDict_GetItemWithError(). Patch by Xiang Zhang.
* Issue #28583: PyDict_SetDefault didn't combine split table when needed.INADA Naoki2016-11-021-15/+45
| | | | Patch by Xiang Zhang.
* Backed out changeset 6b88dfc7b25dSerhiy Storchaka2016-10-311-63/+60
|
* Issue #28199: Microoptimized dict resizing. Based on patch by Naoki Inada.Serhiy Storchaka2016-10-291-60/+63
|
* Issue #28544: Pass `PyObject*` to _PyDict_Pop, not `PyDictObject*`Yury Selivanov2016-10-281-2/+6
|
* Issue #28509: dict.update() no longer allocate unnecessary large memoryINADA Naoki2016-10-271-2/+4
|
* - dictobject.c: Make dict_merge symbol a static symboldoko@ubuntu.com2016-10-111-1/+1
|
* Issue #28183: Optimize and cleanup dict iteration.Serhiy Storchaka2016-10-091-109/+106
|
* Issue #28201: Dict reduces possibility of 2nd conflict in hash table.INADA Naoki2016-10-061-16/+22
| | | | Do perturb shift after first conflict.
* Issue #27358: Optimized merging var-keyword arguments and improved errorSerhiy Storchaka2016-10-021-9/+36
| | | | message when pass a non-mapping as a var-keyword argument.
* issue #28144: Decrease empty_keys_struct's dk_refcntSerhiy Storchaka2016-09-261-1/+1
| | | | | since there is no dummy_struct any more. Patch by Xiang Zhang.
* Issue #28194: Clean up some checks in dict implementation.Serhiy Storchaka2016-09-261-10/+11
| | | | Patch by Xiang Zhang.
* mergeRaymond Hettinger2016-09-191-1/+1
|
* Add _PyDict_CheckConsistency()Victor Stinner2016-09-141-2/+88
| | | | | | | | Issue #28127: Add a function to check that a dictionary remains consistent after any change. By default, tables are not checked, only basic attributes. Define DEBUG_PYDICT (ex: gcc -D DEBUG_PYDICT) to also check dictionary "content".
* Fix _PyDict_Pop() on pending keyVictor Stinner2016-09-131-1/+1
| | | | | | | Issue #28120: Fix dict.pop() for splitted dictionary when trying to remove a "pending key" (Not yet inserted in split-table). Patch by Xiang Zhang.
* Issue #28040: Cleanup find_empty_slot()Victor Stinner2016-09-131-6/+2
| | | | find_empty_slot() only supports combined dict
* Issue #28077: find_empty_slot() only supports combined dictVictor Stinner2016-09-121-3/+7
|
* Fixed compiler warnings in compact dict implementation on 32-bit platforms.Serhiy Storchaka2016-09-101-11/+11
|
* dictobject.c: explain why stringlib is usedVictor Stinner2016-09-101-1/+1
|
* Fix SystemError in compact dictVictor Stinner2016-09-101-19/+33
| | | | | | | | | Issue #28040: Fix _PyDict_DelItem_KnownHash() and _PyDict_Pop(): convert splitted table to combined table to be able to delete the item. Write an unit test for the issue. Patch by INADA Naoki.
* Issue #28033: Fix typo in dictobject.cBerker Peksag2016-09-091-1/+1
| | | | Patch by Wesley Emeneker.
* do not worry about 64-bit dict sizes on 32-bit platformsBenjamin Peterson2016-09-081-3/+7
|
* Add a new private version to the builtin dict typeVictor Stinner2016-09-081-0/+19
| | | | | | | Issue #26058: Add a new private version to the builtin dict type, incremented at each dictionary creation and at each dictionary change. Implementation of the PEP 509.
* access dk_indices through a unionBenjamin Peterson2016-09-081-16/+12
|
* Add documentation to the dict implementationVictor Stinner2016-09-081-1/+1
| | | | Issue #27350.
* Reindeint DK_xxx macrosVictor Stinner2016-09-081-6/+11
| | | | Issue #27350.
* dk_get_index/dk_set_index uses a type indices variableVictor Stinner2016-09-081-8/+16
| | | | Issue #27350.
* Split lookdict_unicode_nodummy() assertion to debugVictor Stinner2016-09-081-1/+2
| | | | Issue #27350.
* Add assertions to dk_set_index()Victor Stinner2016-09-081-4/+14
| | | | Issue #27350.
* link to canonical blogspotBenjamin Peterson2016-09-081-1/+1
|
* use native inline instead of Py_LOCAL_INLINEBenjamin Peterson2016-09-081-3/+3
|
* rearrange to make gcc happyBenjamin Peterson2016-09-081-1/+3
|
* Add Py_MEMBER_SIZE macroVictor Stinner2016-09-081-8/+12
| | | | | Issue #27350: use Py_MEMBER_SIZE() macro to get the size of PyDictKeyEntry.dk_indices, rather than hardcoding 8.
* Implement compact dictVictor Stinner2016-09-081-534/+715
| | | | | | | | | | | | Issue #27350: `dict` implementation is changed like PyPy. It is more compact and preserves insertion order. _PyDict_Dummy() function has been removed. Disable test_gdb: python-gdb.py is not updated yet to the new structure of compact dictionaries (issue #28023). Patch written by INADA Naoki.
* remove memory indirections in dict_traverse (closes #27956)Benjamin Peterson2016-09-051-9/+11
|
* Merge: #20647: Update dictobject.c comments to account for randomized string ↵R David Murray2016-07-101-8/+5
|\ | | | | | | hashes.
| * #20647: Update dictobject.c comments to account for randomized string hashes.R David Murray2016-07-101-8/+5
| | | | | | | | Patch by Jaysinh Shukla.
* | Issue #26494: Fixed crash on iterating exhausting iterators.Serhiy Storchaka2016-03-301-3/+3
|\ \ | |/ | | | | | | | | Affected classes are generic sequence iterators, iterators of str, bytes, bytearray, list, tuple, set, frozenset, dict, OrderedDict, corresponding views and os.scandir() iterator.
| * Issue #26494: Fixed crash on iterating exhausting iterators.Serhiy Storchaka2016-03-301-3/+3
| | | | | | | | | | | | Affected classes are generic sequence iterators, iterators of str, bytes, bytearray, list, tuple, set, frozenset, dict, OrderedDict, corresponding views and os.scandir() iterator.
* | merge 3.5 (closes #26478)Benjamin Peterson2016-03-041-5/+4
|\ \ | |/
| * merge 3.4 (closes #26478)Benjamin Peterson2016-03-041-5/+4
| |\
| | * properly use the ObjArgs variant of CallMethod in dictview binary operations ↵Benjamin Peterson2016-03-041-5/+4
| | | | | | | | | | | | (closes #26478)
* | | Issue #23601: Use small object allocator for dict key objectsRaymond Hettinger2016-01-311-3/+3
| | |
* | | Merge 3.5Victor Stinner2016-01-201-4/+2
|\ \ \ | |/ / | | | | | | Issue #26154: Add a new private _PyThreadState_UncheckedGet() function.
| * | Add _PyThreadState_UncheckedGet()Victor Stinner2016-01-201-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Issue #26154: Add a new private _PyThreadState_UncheckedGet() function which gets the current thread state, but don't call Py_FatalError() if it is NULL. Python 3.5.1 removed the _PyThreadState_Current symbol from the Python C API to no more expose complex and private atomic types. Atomic types depends on the compiler or can even depend on compiler options. The new function _PyThreadState_UncheckedGet() allows to get the variable value without having to care of the exact implementation of atomic types. Changes: * Replace direct usage of the _PyThreadState_Current variable with a call to _PyThreadState_UncheckedGet(). * In pystate.c, replace direct usage of the _PyThreadState_Current variable with the PyThreadState_GET() macro for readability. * Document also PyThreadState_Get() in pystate.h
* | | - merge 3.5doko@ubuntu.com2016-01-141-1/+1
|\ \ \ | |/ /
| * | dictobject.c(dict_sizeof): Make it static again.doko@ubuntu.com2016-01-141-1/+1
| | |
* | | Issue #25923: Added more const qualifiers to signatures of static and ↵Serhiy Storchaka2015-12-251-1/+1
| | | | | | | | | | | | private functions.
* | | Issue #25914: Fixed and simplified OrderedDict.__sizeof__.Serhiy Storchaka2015-12-221-3/+9
|\ \ \ | |/ /