mirror of
https://github.com/python/cpython.git
synced 2025-10-17 20:28:43 +00:00
gh-111178: Fix function signatures for multiple tests (#131496)
This commit is contained in:
parent
486d537065
commit
34c1ea3109
15 changed files with 112 additions and 69 deletions
|
@ -2433,14 +2433,15 @@ error:
|
|||
|
||||
|
||||
static int
|
||||
hamt_baseiter_tp_clear(PyHamtIterator *it)
|
||||
hamt_baseiter_tp_clear(PyObject *op)
|
||||
{
|
||||
PyHamtIterator *it = (PyHamtIterator*)op;
|
||||
Py_CLEAR(it->hi_obj);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
hamt_baseiter_tp_dealloc(PyHamtIterator *it)
|
||||
hamt_baseiter_tp_dealloc(PyObject *it)
|
||||
{
|
||||
PyObject_GC_UnTrack(it);
|
||||
(void)hamt_baseiter_tp_clear(it);
|
||||
|
@ -2448,15 +2449,17 @@ hamt_baseiter_tp_dealloc(PyHamtIterator *it)
|
|||
}
|
||||
|
||||
static int
|
||||
hamt_baseiter_tp_traverse(PyHamtIterator *it, visitproc visit, void *arg)
|
||||
hamt_baseiter_tp_traverse(PyObject *op, visitproc visit, void *arg)
|
||||
{
|
||||
PyHamtIterator *it = (PyHamtIterator*)op;
|
||||
Py_VISIT(it->hi_obj);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static PyObject *
|
||||
hamt_baseiter_tp_iternext(PyHamtIterator *it)
|
||||
hamt_baseiter_tp_iternext(PyObject *op)
|
||||
{
|
||||
PyHamtIterator *it = (PyHamtIterator*)op;
|
||||
PyObject *key;
|
||||
PyObject *val;
|
||||
hamt_iter_t res = hamt_iterator_next(&it->hi_iter, &key, &val);
|
||||
|
@ -2477,13 +2480,14 @@ hamt_baseiter_tp_iternext(PyHamtIterator *it)
|
|||
}
|
||||
|
||||
static Py_ssize_t
|
||||
hamt_baseiter_tp_len(PyHamtIterator *it)
|
||||
hamt_baseiter_tp_len(PyObject *op)
|
||||
{
|
||||
PyHamtIterator *it = (PyHamtIterator*)op;
|
||||
return it->hi_obj->h_count;
|
||||
}
|
||||
|
||||
static PyMappingMethods PyHamtIterator_as_mapping = {
|
||||
(lenfunc)hamt_baseiter_tp_len,
|
||||
hamt_baseiter_tp_len,
|
||||
};
|
||||
|
||||
static PyObject *
|
||||
|
@ -2506,11 +2510,11 @@ hamt_baseiter_new(PyTypeObject *type, binaryfunc yield, PyHamtObject *o)
|
|||
.tp_basicsize = sizeof(PyHamtIterator), \
|
||||
.tp_itemsize = 0, \
|
||||
.tp_as_mapping = &PyHamtIterator_as_mapping, \
|
||||
.tp_dealloc = (destructor)hamt_baseiter_tp_dealloc, \
|
||||
.tp_dealloc = hamt_baseiter_tp_dealloc, \
|
||||
.tp_getattro = PyObject_GenericGetAttr, \
|
||||
.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, \
|
||||
.tp_traverse = (traverseproc)hamt_baseiter_tp_traverse, \
|
||||
.tp_clear = (inquiry)hamt_baseiter_tp_clear, \
|
||||
.tp_traverse = hamt_baseiter_tp_traverse, \
|
||||
.tp_clear = hamt_baseiter_tp_clear, \
|
||||
.tp_iter = PyObject_SelfIter, \
|
||||
.tp_iternext = (iternextfunc)hamt_baseiter_tp_iternext,
|
||||
|
||||
|
|
|
@ -378,13 +378,21 @@ tracemalloc_create_traces_table(void)
|
|||
}
|
||||
|
||||
|
||||
static void
|
||||
tracemalloc_destroy_domain(void *value)
|
||||
{
|
||||
_Py_hashtable_t *ht = (_Py_hashtable_t*)value;
|
||||
_Py_hashtable_destroy(ht);
|
||||
}
|
||||
|
||||
|
||||
static _Py_hashtable_t*
|
||||
tracemalloc_create_domains_table(void)
|
||||
{
|
||||
return hashtable_new(hashtable_hash_uint,
|
||||
_Py_hashtable_compare_direct,
|
||||
NULL,
|
||||
(_Py_hashtable_destroy_func)_Py_hashtable_destroy);
|
||||
tracemalloc_destroy_domain);
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue