Implement compact dict

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.
This commit is contained in:
Victor Stinner 2016-09-07 17:40:12 -07:00
parent d8b7770a0e
commit 742da040db
12 changed files with 793 additions and 569 deletions

View file

@ -22,12 +22,6 @@ _Py_GetRefTotal(void)
{
PyObject *o;
Py_ssize_t total = _Py_RefTotal;
/* ignore the references to the dummy object of the dicts and sets
because they are not reliable and not useful (now that the
hash table code is well-tested) */
o = _PyDict_Dummy();
if (o != NULL)
total -= o->ob_refcnt;
o = _PySet_Dummy;
if (o != NULL)
total -= o->ob_refcnt;