summaryrefslogtreecommitdiffstats
path: root/Include/internal/pycore_hashtable.h
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2020-05-13 01:52:11 (GMT)
committerGitHub <noreply@github.com>2020-05-13 01:52:11 (GMT)
commitd95bd4214c2babe851b02562d973d60c02e639b7 (patch)
tree75f9961793fecd850e1b4455bb8a6383add6b9bf /Include/internal/pycore_hashtable.h
parent2d0a3d682f699cce8db6e30981d41d9125318726 (diff)
downloadcpython-d95bd4214c2babe851b02562d973d60c02e639b7.zip
cpython-d95bd4214c2babe851b02562d973d60c02e639b7.tar.gz
cpython-d95bd4214c2babe851b02562d973d60c02e639b7.tar.bz2
bpo-40609: _tracemalloc allocates traces (GH-20064)
Rewrite _tracemalloc to store "trace_t*" rather than directly "trace_t" in traces hash tables. Traces are now allocated on the heap memory, outside the hash table. Add tracemalloc_copy_traces() and tracemalloc_copy_domains() helper functions. Remove _Py_hashtable_copy() function since there is no API to copy a key or a value. Remove also _Py_hashtable_delete() function which was commented.
Diffstat (limited to 'Include/internal/pycore_hashtable.h')
-rw-r--r--Include/internal/pycore_hashtable.h10
1 files changed, 0 insertions, 10 deletions
diff --git a/Include/internal/pycore_hashtable.h b/Include/internal/pycore_hashtable.h
index 3c7483a..0da2ffd 100644
--- a/Include/internal/pycore_hashtable.h
+++ b/Include/internal/pycore_hashtable.h
@@ -45,13 +45,6 @@ typedef struct {
sizeof(DATA)); \
} while (0)
-#define _Py_HASHTABLE_ENTRY_WRITE_DATA(TABLE, ENTRY, DATA) \
- do { \
- assert(sizeof(DATA) == (TABLE)->data_size); \
- memcpy((void *)_Py_HASHTABLE_ENTRY_PDATA(ENTRY), \
- &(DATA), sizeof(DATA)); \
- } while (0)
-
/* _Py_hashtable: prototypes */
@@ -118,9 +111,6 @@ PyAPI_FUNC(_Py_hashtable_t *) _Py_hashtable_new_full(
PyAPI_FUNC(void) _Py_hashtable_destroy(_Py_hashtable_t *ht);
-/* Return a copy of the hash table */
-PyAPI_FUNC(_Py_hashtable_t *) _Py_hashtable_copy(_Py_hashtable_t *src);
-
PyAPI_FUNC(void) _Py_hashtable_clear(_Py_hashtable_t *ht);
typedef int (*_Py_hashtable_foreach_func) (_Py_hashtable_t *ht,