Skip to content

Commit 989fa8e

Browse files
committed
Test statically allocated
1 parent 9af48c2 commit 989fa8e

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

Include/internal/pycore_interp_structs.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -900,7 +900,7 @@ struct _is {
900900
struct _qsbr_shared qsbr;
901901

902902
#ifdef _Py_TIER2
903-
struct _PyUOpInstruction *jit_uop_buffer;
903+
struct _PyUOpInstruction jit_uop_buffer[UOP_MAX_TRACE_LENGTH];
904904
#endif
905905

906906
#if defined(Py_GIL_DISABLED)

Python/optimizer.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1281,12 +1281,14 @@ uop_optimize(
12811281
_PyBloomFilter dependencies;
12821282
_Py_BloomFilter_Init(&dependencies);
12831283
PyInterpreterState *interp = _PyInterpreterState_GET();
1284+
/**
12841285
if (interp->jit_uop_buffer == NULL) {
12851286
interp->jit_uop_buffer = (_PyUOpInstruction *)PyMem_RawMalloc(UOP_MAX_TRACE_LENGTH*sizeof(_PyUOpInstruction));
12861287
if (interp->jit_uop_buffer == NULL) {
12871288
return 0;
12881289
}
12891290
}
1291+
**/
12901292
_PyUOpInstruction *buffer = interp->jit_uop_buffer;
12911293
OPT_STAT_INC(attempts);
12921294
char *env_var = Py_GETENV("PYTHON_UOPS_OPTIMIZE");

Python/pystate.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -559,7 +559,7 @@ init_interpreter(PyInterpreterState *interp,
559559

560560
#ifdef _Py_TIER2
561561
// Ensure the buffer is to be set as NULL.
562-
interp->jit_uop_buffer = NULL;
562+
// interp->jit_uop_buffer = NULL;
563563
#endif
564564
llist_init(&interp->mem_free_queue.head);
565565
llist_init(&interp->asyncio_tasks_head);
@@ -808,10 +808,12 @@ interpreter_clear(PyInterpreterState *interp, PyThreadState *tstate)
808808

809809
#ifdef _Py_TIER2
810810
_Py_ClearExecutorDeletionList(interp);
811+
/**
811812
if (interp->jit_uop_buffer != NULL) {
812813
PyMem_RawFree(interp->jit_uop_buffer);
813814
interp->jit_uop_buffer = NULL;
814815
}
816+
**/
815817
#endif
816818
_PyAST_Fini(interp);
817819
_PyAtExit_Fini(interp);

0 commit comments

Comments
 (0)