summaryrefslogtreecommitdiffstats
path: root/Python/marshal.c
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2016-03-21 13:36:39 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2016-03-21 13:36:39 (GMT)
commit322bc12c3142e7816dd34c6c3085929ab29d3ed8 (patch)
tree6198f0a586970bd578569611eaefb6a059338916 /Python/marshal.c
parentfac395681fb758401d17974f258b17d285336c57 (diff)
downloadcpython-322bc12c3142e7816dd34c6c3085929ab29d3ed8.zip
cpython-322bc12c3142e7816dd34c6c3085929ab29d3ed8.tar.gz
cpython-322bc12c3142e7816dd34c6c3085929ab29d3ed8.tar.bz2
Ooops, revert changeset ea9efa06c137
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 """
Diffstat (limited to 'Python/marshal.c')
-rw-r--r--Python/marshal.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/Python/marshal.c b/Python/marshal.c
index 64084f4..7a4b9d2 100644
--- a/Python/marshal.c
+++ b/Python/marshal.c
@@ -263,7 +263,7 @@ w_ref(PyObject *v, char *flag, WFILE *p)
if (Py_REFCNT(v) == 1)
return 0;
- entry = _Py_HASHTABLE_GET_ENTRY(p->hashtable, v);
+ entry = _Py_hashtable_get_entry(p->hashtable, v);
if (entry != NULL) {
/* write the reference index to the stream */
_Py_HASHTABLE_ENTRY_READ_DATA(p->hashtable, &w, sizeof(w), entry);
@@ -571,8 +571,7 @@ static int
w_init_refs(WFILE *wf, int version)
{
if (version >= 3) {
- wf->hashtable = _Py_hashtable_new(sizeof(void *), sizeof(int),
- _Py_hashtable_hash_ptr,
+ wf->hashtable = _Py_hashtable_new(sizeof(int), _Py_hashtable_hash_ptr,
_Py_hashtable_compare_direct);
if (wf->hashtable == NULL) {
PyErr_NoMemory();
@@ -583,11 +582,9 @@ w_init_refs(WFILE *wf, int version)
}
static int
-w_decref_entry(_Py_hashtable_t *ht, _Py_hashtable_entry_t *entry, void *Py_UNUSED(data))
+w_decref_entry(_Py_hashtable_entry_t *entry, void *Py_UNUSED(data))
{
- void *entry_key = *(void **)_Py_HASHTABLE_ENTRY_KEY(entry);
- assert(ht->key_size == sizeof(entry_key));
- Py_XDECREF(entry_key);
+ Py_XDECREF(entry->key);
return 0;
}