From 54f6cd6bb72f30fda9d54e273f7118c39d470e69 Mon Sep 17 00:00:00 2001 From: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com> Date: Sat, 18 Oct 2025 22:00:28 +0100 Subject: [PATCH] Remove unused buffer --- Include/internal/pycore_interp_structs.h | 1 - Python/optimizer.c | 6 ------ Python/pystate.c | 6 ------ 3 files changed, 13 deletions(-) diff --git a/Include/internal/pycore_interp_structs.h b/Include/internal/pycore_interp_structs.h index 42295de90478..222db736a9f4 100644 --- a/Include/internal/pycore_interp_structs.h +++ b/Include/internal/pycore_interp_structs.h @@ -959,7 +959,6 @@ struct _is { // End Jit tracing state bool jit; bool compiling; - struct _PyUOpInstruction *jit_uop_buffer; struct _PyExecutorObject *executor_list_head; struct _PyExecutorObject *executor_deletion_list_head; struct _PyExecutorObject *cold_executor; diff --git a/Python/optimizer.c b/Python/optimizer.c index 39c1cfd6d697..5fdd73d1e622 100644 --- a/Python/optimizer.c +++ b/Python/optimizer.c @@ -1195,12 +1195,6 @@ uop_optimize( { _PyBloomFilter *dependencies = &tstate->interp->jit_tracer_dependencies; PyInterpreterState *interp = _PyInterpreterState_GET(); - if (interp->jit_uop_buffer == NULL) { - interp->jit_uop_buffer = (_PyUOpInstruction *)_PyObject_VirtualAlloc(UOP_BUFFER_SIZE); - if (interp->jit_uop_buffer == NULL) { - return 0; - } - } _PyUOpInstruction *buffer = interp->jit_tracer_code_buffer; OPT_STAT_INC(attempts); char *env_var = Py_GETENV("PYTHON_UOPS_OPTIMIZE"); diff --git a/Python/pystate.c b/Python/pystate.c index 671daabd1edb..aebe7c107d1b 100644 --- a/Python/pystate.c +++ b/Python/pystate.c @@ -553,8 +553,6 @@ init_interpreter(PyInterpreterState *interp, #endif #ifdef _Py_TIER2 - // Ensure the buffer is to be set as NULL. - interp->jit_uop_buffer = NULL; interp->jit_tracer_code_buffer = NULL; interp->jit_tracer_initial_instr = NULL; interp->jit_tracer_initial_stack_depth = -1; @@ -810,10 +808,6 @@ interpreter_clear(PyInterpreterState *interp, PyThreadState *tstate) #ifdef _Py_TIER2 _Py_ClearExecutorDeletionList(interp); - if (interp->jit_uop_buffer != NULL) { - _PyObject_VirtualFree(interp->jit_uop_buffer, UOP_BUFFER_SIZE); - interp->jit_uop_buffer = NULL; - } if (interp->jit_tracer_code_buffer != NULL) { _PyObject_VirtualFree(interp->jit_tracer_code_buffer, UOP_BUFFER_SIZE); interp->jit_tracer_code_buffer = NULL; -- 2.47.3