GH-84436: Skip refcounting for known immortals (GH-107605)

This commit is contained in:
Brandt Bucher 2023-08-04 16:24:50 -07:00 committed by GitHub
parent ec0a0d2bd9
commit 05a824f294
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
19 changed files with 52 additions and 65 deletions

View file

@ -514,7 +514,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);