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

Skip to content
8000

gh-81057: Move tracemalloc Globals to _PyRuntimeState #100151

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
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

8000
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Move tracemalloc_empty_traceback to _PyRuntimeState.
  • Loading branch information
ericsnowcurrently committed Dec 9, 2022
commit 95f51a21d2fcaa571dc7880a497840156ae50ea5
2 changes: 2 additions & 0 deletions Include/internal/pycore_tracemalloc.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ struct _tracemalloc_runtime_state {
Protected by TABLES_LOCK(). */
_Py_hashtable_t *domains;

struct tracemalloc_traceback empty_traceback;

Py_tss_t reentrant_key;
};

Expand Down
3 changes: 2 additions & 1 deletion Modules/_tracemalloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ typedef struct tracemalloc_traceback traceback_t;
static const unsigned long MAX_NFRAME = Py_MIN(UINT16_MAX, ((SIZE_MAX - sizeof(traceback_t)) / sizeof(frame_t) + 1));


static traceback_t tracemalloc_empty_traceback;
#define tracemalloc_empty_traceback _PyRuntime.tracemalloc.empty_traceback


/* Trace of a memory block */
typedef struct {
Expand Down
1 change: 0 additions & 1 deletion Tools/c-analyzer/cpython/globals-to-fix.tsv
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,6 @@ Modules/faulthandler.c - old_stack -
##-----------------------
## state

Modules/_tracemalloc.c - tracemalloc_empty_traceback -
Modules/faulthandler.c faulthandler_dump_traceback reentrant -
Modules/signalmodule.c - is_tripped -
Modules/signalmodule.c - signal_global_state -
Expand Down
0