]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
bpo-40609: _Py_hashtable_t values become void* (GH-20065)
authorVictor Stinner <vstinner@python.org>
Wed, 13 May 2020 02:40:30 +0000 (04:40 +0200)
committerGitHub <noreply@github.com>
Wed, 13 May 2020 02:40:30 +0000 (04:40 +0200)
commit5b0a30354d8a8bb39a05ce10ca4f5c78b729f25b
tree82d3cb7f273b6af8b95d47546c56732258d19333
parentd95bd4214c2babe851b02562d973d60c02e639b7
bpo-40609: _Py_hashtable_t values become void* (GH-20065)

_Py_hashtable_t values become regular "void *" pointers.

* Add _Py_hashtable_entry_t.data member
* Remove _Py_hashtable_t.data_size member
* Remove _Py_hashtable_t.get_func member. It is no longer needed
  to specialize _Py_hashtable_get() for a specific value size, since
  all entries now have the same size (void*).
* Remove the following macros:

  * _Py_HASHTABLE_GET()
  * _Py_HASHTABLE_SET()
  * _Py_HASHTABLE_SET_NODATA()
  * _Py_HASHTABLE_POP()

* Rename _Py_hashtable_pop() to _Py_hashtable_steal()
* _Py_hashtable_foreach() callback now gets key and value rather than
  entry.
* Remove _Py_hashtable_value_destroy_func type. value_destroy_func
  callback now only has a single parameter: data (void*).
Include/internal/pycore_hashtable.h
Modules/_tracemalloc.c
Python/hashtable.c
Python/marshal.c