summaryrefslogtreecommitdiffstats
path: root/contrib/tools/python3/Python/hamt.c
diff options
context:
space:
mode:
authorshadchin <[email protected]>2026-02-03 21:59:07 +0300
committershadchin <[email protected]>2026-02-03 22:28:51 +0300
commitbce46f28de392862d5c6c3b185d844ee7c623be3 (patch)
tree424878b5b90144f98970ce4a2745990c77330ad2 /contrib/tools/python3/Python/hamt.c
parent0e0ee9fa48ce9411b4038aa769493d22ff6c10a2 (diff)
Import Python 3.13.11
commit_hash:bbb53cefb159aa3e7afaa475fd19d5a03b66945f
Diffstat (limited to 'contrib/tools/python3/Python/hamt.c')
-rw-r--r--contrib/tools/python3/Python/hamt.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/contrib/tools/python3/Python/hamt.c b/contrib/tools/python3/Python/hamt.c
index 8cb94641bef..91abaecd3e7 100644
--- a/contrib/tools/python3/Python/hamt.c
+++ b/contrib/tools/python3/Python/hamt.c
@@ -1,9 +1,10 @@
#include "Python.h"
-
-#include "pycore_bitutils.h" // _Py_popcount32
+#include "pycore_bitutils.h" // _Py_popcount32()
#include "pycore_hamt.h"
#include "pycore_initconfig.h" // _PyStatus_OK()
+#include "pycore_long.h" // _PyLong_Format()
#include "pycore_object.h" // _PyObject_GC_TRACK()
+
#include <stddef.h> // offsetof()
/*
@@ -255,9 +256,9 @@ Debug
=====
The HAMT datatype is accessible for testing purposes under the
-`_testcapi` module:
+`_testinternalcapi` module:
- >>> from _testcapi import hamt
+ >>> from _testinternalcapi import hamt
>>> h = hamt()
>>> h2 = h.set('a', 2)
>>> h3 = h2.set('b', 3)
@@ -514,7 +515,7 @@ hamt_node_bitmap_new(Py_ssize_t size)
/* Since bitmap nodes are immutable, we can cache the instance
for size=0 and reuse it whenever we need an empty bitmap node.
*/
- return (PyHamtNode *)Py_NewRef(&_Py_SINGLETON(hamt_bitmap_node_empty));
+ return (PyHamtNode *)&_Py_SINGLETON(hamt_bitmap_node_empty);
}
assert(size >= 0);
@@ -2425,7 +2426,7 @@ hamt_alloc(void)
}
#define _empty_hamt \
- (&_Py_INTERP_SINGLETON(_PyInterpreterState_Get(), hamt_empty))
+ (&_Py_INTERP_SINGLETON(_PyInterpreterState_GET(), hamt_empty))
PyHamtObject *
_PyHamt_New(void)