8000 gh-120501: Fix reference leak in JIT build by Eclips4 · Pull Request #120649 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-120501: Fix reference leak in JIT build #120649

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 17 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
-->
Next Next commit
First try to fix..
  • Loading branch information
Eclips4 committed Jun 17, 2024
commit 871dc4c13bc84bdb93a30d5d5c3d59ac8fe1de17
1 change: 1 addition & 0 deletions Include/cpython/optimizer.h
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ PyAPI_FUNC(_PyExecutorObject *) PyUnstable_GetExecutor(PyCodeObject *code, int o

void _Py_ExecutorInit(_PyExecutorObject *, const _PyBloomFilter *);
void _Py_ExecutorDetach(_PyExecutorObject *);
int _Py_ExecutorClear(_PyExecutorObject *);
void _Py_BloomFilter_Init(_PyBloomFilter *);
void _Py_BloomFilter_Add(_PyBloomFilter *bloom, void *obj);
PyAPI_FUNC(void) _Py_Executor_DependsOn(_PyExecutorObject *executor, void *obj);
Expand Down
10 changes: 8 additions & 2 deletions Python/optimizer.c
Original file line number Diff line number Diff line change
Expand Up @@ -1617,8 +1617,9 @@ _Py_ExecutorDetach(_PyExecutorObject *executor)
Py_DECREF(executor);
}

static int
executor_clear(_PyExecutorObject *executor)

int
_Py_ExecutorClear(_PyExecutorObject *executor)
{
if (!executor->vm_data.valid) {
return 0;
Expand All @@ -1644,6 +1645,11 @@ executor_clear(_PyExecutorObject *executor)
Py_DECREF(executor);
return 0;
}
static int
executor_clear(_PyExecutorObject *executor)
{
return _Py_ExecutorClear(executor);
}

void
_Py_Executor_DependsOn(_PyExecutorObject *executor, void *obj)
Expand Down
0