8000 gh-81057: Add PyInterpreterState.static_objects by ericsnowcurrently · Pull Request #99397 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-81057: Add PyInterpreterState.static_objects #99397

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
Show file tree
Hide file tree
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
Next Next commit
Pass the interpreter to _PyStaticObjects_CheckRefcnt().
  • Loading branch information
ericsnowcurrently committed Nov 11, 2022
commit 877c5f933fcd77455e5b393157e4777434d199b3
2 changes: 1 addition & 1 deletion Python/pylifecycle.c
Original file line number Diff line number Diff line change
Expand Up @@ -1744,7 +1744,7 @@ finalize_interp_types(PyInterpreterState *interp)
_PyUnicode_Fini(interp);
_PyFloat_Fini(interp);
#ifdef Py_DEBUG
_PyStaticObjects_CheckRefcnt();
_PyStaticObjects_CheckRefcnt(interp);
#endif
}

Expand Down
6 changes: 4 additions & 2 deletions Tools/build/generate_global_objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -383,8 +383,10 @@ def generate_global_object_finalizers(generated_immortal_objects):
printer.write(START)
printer.write('#ifdef Py_DEBUG')
printer.write("static inline void")
with printer.block("_PyStaticObjects_CheckRefcnt(void)"):
printer.write('/* generated (see pycore_runtime_init_generated.h) */')
with printer.block(
"_PyStaticObjects_CheckRefcnt(PyInterpreterState *interp)"):
printer.write('/* generated runtime-global */')
printer.write('// (see pycore_runtime_init_generated.h)')
for ref in generated_immortal_objects:
printer.write(f'_PyStaticObject_CheckRefcnt({ref});')
printer.write('/* non-generated */')
Expand Down
0