summaryrefslogtreecommitdiffstats
path: root/Modules/hashtable.c
Commit message (Collapse)AuthorAgeFilesLines
* Replace KB unit with KiB (#4293)Victor Stinner2017-11-081-1/+1
| | | | | | | | | | | kB (*kilo* byte) unit means 1000 bytes, whereas KiB ("kibibyte") means 1024 bytes. KB was misused: replace kB or KB with KiB when appropriate. Same change for MB and GB which become MiB and GiB. Change the output of Tools/iobench/iobench.py. Round also the size of the documentation from 5.5 MB to 5 MiB.
* Issue #28126: Replace Py_MEMCPY with memcpy(). Visual Studio can properly ↵Christian Heimes2016-09-131-3/+3
| | | | optimize memcpy().
* merge 3.5Benjamin Peterson2016-09-071-1/+2
|\
| * do not memcpy from NULLBenjamin Peterson2016-09-071-1/+2
| |
* | Cleanup hashtable.hVictor Stinner2016-03-231-22/+33
| | | | | | | | | | | | | | | | | | | | | | | | Issue #26588: * Pass the hash table rather than the key size to hash and compare functions * _Py_HASHTABLE_READ_KEY() and _Py_HASHTABLE_ENTRY_READ_KEY() macros now expect the hash table as the first parameter, rather than the key size * tracemalloc_get_traces_fill(): use _Py_HASHTABLE_ENTRY_READ_DATA() rather than pointer dereference * Remove the _Py_HASHTABLE_ENTRY_WRITE_PKEY() macro * Move "PKEY" and "PDATA" macros inside hashtable.c
* | Issue #26588:Victor Stinner2016-03-231-6/+4
| | | | | | | | | | | | | | | | * _Py_HASHTABLE_ENTRY_DATA: change type from "char *" to "const void *" * Add _Py_HASHTABLE_ENTRY_WRITE_PKEY() macro * Rename _Py_HASHTABLE_ENTRY_WRITE_DATA() macro to _Py_HASHTABLE_ENTRY_WRITE_PDATA() * Add _Py_HASHTABLE_ENTRY_WRITE_DATA() macro
* | Remove _Py_hashtable_delete()Victor Stinner2016-03-221-0/+3
| | | | | | | | | | | | Issue #26588: Remove _Py_hashtable_delete() from hashtable.h since the function is not used. Keep the C code in hashtable.c as commented code if someone needs it later.
* | Simplify implementation of hashtable.cVictor Stinner2016-03-221-47/+8
| | | | | | | | | | | | | | | | | | | | | | 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.
* | hashtable.h now supports keys of any sizeVictor Stinner2016-03-211-58/+89
| | | | | | | | | | | | Issue #26588: hashtable.h now supports keys of any size, not only sizeof(void*). It allows to support key larger than sizeof(void*), but also to use less memory for key smaller than sizeof(void*).
* | Ooops, revert changeset ea9efa06c137Victor Stinner2016-03-211-62/+43
| | | | | | | | | | | | | | | | | | | | | | Change pushed by mistake, the patch is still under review :-/ """ _tracemalloc: add domain to trace keys * hashtable.h: key has now a variable size * _tracemalloc uses (pointer: void*, domain: unsigned int) as key for traces """
* | _tracemalloc: add domain to trace keysVictor Stinner2016-03-181-43/+62
| | | | | | | | | | * hashtable.h: key has now a variable size * _tracemalloc uses (pointer: void*, domain: unsigned int) as key for traces
* | On memory error, dump the memory block tracebackVictor Stinner2016-03-151-3/+3
|/ | | | | | Issue #26564: _PyObject_DebugDumpAddress() now dumps the traceback where a memory block was allocated on memory block. Use the tracemalloc module to get the traceback.
* Closes #21892, #21893: Use PY_FORMAT_SIZE_T instead of %zi or %zu to format CVictor Stinner2014-07-011-2/+3
| | | | size_t, because %zi/%u is not supported on all platforms.
* Issue #21036: Fix typo in macro nameVictor Stinner2014-03-241-2/+2
| | | | _PY_HASHTABLE_ENTRY_DATA => _Py_HASHTABLE_ENTRY_DATA
* Issue #18874: Implement the PEP 454 (tracemalloc)Victor Stinner2013-11-231-0/+518