Skip to content

Commit 95f51a2

Browse files
Move tracemalloc_empty_traceback to _PyRuntimeState.
1 parent 75528df commit 95f51a2

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

Include/internal/pycore_tracemalloc.h

+2
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,8 @@ struct _tracemalloc_runtime_state {
9999
Protected by TABLES_LOCK(). */
100100
_Py_hashtable_t *domains;
101101

102+
struct tracemalloc_traceback empty_traceback;
103+
102104
Py_tss_t reentrant_key;
103105
};
104106

Modules/_tracemalloc.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,8 @@ typedef struct tracemalloc_traceback traceback_t;
6363
static const unsigned long MAX_NFRAME = Py_MIN(UINT16_MAX, ((SIZE_MAX - sizeof(traceback_t)) / sizeof(frame_t) + 1));
6464

6565

66-
static traceback_t tracemalloc_empty_traceback;
66+
#define tracemalloc_empty_traceback _PyRuntime.tracemalloc.empty_traceback
67+
6768

6869
/* Trace of a memory block */
6970
typedef struct {

Tools/c-analyzer/cpython/globals-to-fix.tsv

-1
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,6 @@ Modules/faulthandler.c - old_stack -
377377
##-----------------------
378378
## state
379379

380-
Modules/_tracemalloc.c - tracemalloc_empty_traceback -
381380
Modules/faulthandler.c faulthandler_dump_traceback reentrant -
382381
Modules/signalmodule.c - is_tripped -
383382
Modules/signalmodule.c - signal_global_state -

0 commit comments

Comments
 (0)