]> granicus.if.org Git - python/commit
Simplify implementation of hashtable.c
authorVictor Stinner <victor.stinner@gmail.com>
Tue, 22 Mar 2016 11:13:01 +0000 (12:13 +0100)
committerVictor Stinner <victor.stinner@gmail.com>
Tue, 22 Mar 2016 11:13:01 +0000 (12:13 +0100)
commitc9553876ae88b7f1494cff826c8f7a08c2ac5614
tree63f4ec83ec78ca95db74b03bd033a4953d27d653
parent0b2d71bc70c32560853fa91f58dc37af8f08090c
Simplify implementation of hashtable.c

Issue #26588: Remove copy_data, free_data and get_data_size callbacks from
hashtable.h. These callbacks are not used in Python and makes the code more
complex.

Remove also the _Py_HASHTABLE_ENTRY_DATA_AS_VOID_P() macro which uses an unsafe
pointer dereference (can cause memory alignment issue). Replace the macro usage
with _Py_HASHTABLE_ENTRY_READ_DATA() which is implemented with the safe
memcpy() function.
Modules/_tracemalloc.c
Modules/hashtable.c
Modules/hashtable.h