You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In bpo-26588, I modified the _tracemalloc module to support tracing memory allocations in multiple "domains" for numpy. I modified hashtable.c to support keys larger than void*, and I modified _tracemalloc.c to use a new pointer_t structure which is made of (domain: unsigned int, ptr: void*).
These changes made hashtable.c way more complicated than what it should be. I would like to reuse hashtable.c in more places. I am working on a change to remove the pointer_t type from _tracemalloc.c, and instead use a hash table for traces of domains other than the default domain (0). The new hash table maps a domain to a hash table: traces of a domain.
tracemalloc_traces remains the default hash table for traces of the default domain. Since it's the most common case, it doesn't go through the new hash table.
Activity
vstinner commentedon May 12, 2020
In bpo-26588, I modified the _tracemalloc module to support tracing memory allocations in multiple "domains" for numpy. I modified hashtable.c to support keys larger than void*, and I modified _tracemalloc.c to use a new pointer_t structure which is made of (domain: unsigned int, ptr: void*).
These changes made hashtable.c way more complicated than what it should be. I would like to reuse hashtable.c in more places. I am working on a change to remove the pointer_t type from _tracemalloc.c, and instead use a hash table for traces of domains other than the default domain (0). The new hash table maps a domain to a hash table: traces of a domain.
tracemalloc_traces remains the default hash table for traces of the default domain. Since it's the most common case, it doesn't go through the new hash table.
vstinner commentedon May 12, 2020
New changeset 9e2ca17 by Victor Stinner in branch 'master':
bpo-40609: Rewrite how _tracemalloc handles domains (GH-20059)
9e2ca17
vstinner commentedon May 13, 2020
New changeset f9b3b58 by Victor Stinner in branch 'master':
bpo-40609: Remove _Py_hashtable_t.key_size (GH-20060)
f9b3b58
vstinner commentedon May 13, 2020
New changeset 2d0a3d6 by Victor Stinner in branch 'master':
bpo-40609: Add destroy functions to _Py_hashtable (GH-20062)
2d0a3d6
vstinner commentedon May 13, 2020
New changeset d95bd42 by Victor Stinner in branch 'master':
bpo-40609: _tracemalloc allocates traces (GH-20064)
d95bd42
vstinner commentedon May 13, 2020
New changeset 5b0a303 by Victor Stinner in branch 'master':
bpo-40609: _Py_hashtable_t values become void* (GH-20065)
5b0a303
vstinner commentedon May 14, 2020
I modified _Py_hashtable_t to remove key_size and data_size: keys are now always "void *" and values are now always "void *".
See also bpo-40602: Move Modules/hashtable.h to Include/internal/pycore_hashtable.h.