]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Remove unused buffer
authorKen Jin <28750310+Fidget-Spinner@users.noreply.github.com>
Sat, 18 Oct 2025 21:00:28 +0000 (22:00 +0100)
committerKen Jin <28750310+Fidget-Spinner@users.noreply.github.com>
Sat, 18 Oct 2025 21:00:28 +0000 (22:00 +0100)
Include/internal/pycore_interp_structs.h
Python/optimizer.c
Python/pystate.c

index 42295de90478f9907b02894271c6c98077bab1c4..222db736a9f4e6623d9666f2f40b7edcbe8867db 100644 (file)
@@ -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;
index 39c1cfd6d697b74b881d74d6288da4d4375ccef4..5fdd73d1e6220ab7d210f1754855d863ff6d32b0 100644 (file)
@@ -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");
index 671daabd1edb2380e819fa5fb1f3d6e3cf0ea7f4..aebe7c107d1b6c3788df0e18a5fdfa9ba4c40b97 100644 (file)
@@ -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;