Skip to content

Commit

Permalink
Move tracemalloc_empty_traceback to _PyRuntimeState.
Browse files Browse the repository at this point in the history
  • Loading branch information
ericsnowcurrently committed Dec 9, 2022
1 parent 75528df commit 95f51a2
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
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 comments on commit 95f51a2

Please sign in to comment.