8000 gh-81057: Move contextvars-related Globals to _PyRuntimeState by ericsnowcurrently · Pull Request #99400 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-81057: Move contextvars-related Globals to _PyRuntimeState #99400

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix refcounts.
  • Loading branch information
ericsnowcurrently committed Nov 11, 2022
commit 68076f5a1864fae14ed136e30aa4ca06e653d0fb
4 changes: 2 additions & 2 deletions Python/hamt.c
Original file line number Diff line number Diff line change
Expand Up @@ -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_SINGLETON(hamt_bitmap_node_empty);
return (PyHamtNode *)Py_NewRef(&_Py_SINGLETON(hamt_bitmap_node_empty));
}

assert(size >= 0);
Expand Down Expand Up @@ -2434,7 +2434,7 @@ _PyHamt_New(void)
{
/* HAMT is an immutable object so we can easily cache an
empty instance. */
return (PyHamtObject*)_empty_hamt;
return (PyHamtObject*)Py_NewRef(_empty_hamt);
}

#ifdef Py_DEBUG
Expand Down
0