Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
Free and NULL-out code caches when needed
  • Loading branch information
Fidget-Spinner committed Oct 11, 2022
commit 982fbc0327e4d030d479f04f8c1b0167fe85403c
1 change: 1 addition & 0 deletions Objects/codeobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -2238,6 +2238,7 @@ _PyStaticCode_Dealloc(PyCodeObject *co)
Py_CLEAR(co->_co_cached->_co_freevars);
Py_CLEAR(co->_co_cached->_co_varnames);
PyMem_Free(co->_co_cached);
co->_co_cached = NULL;
}
co->co_extra = NULL;
if (co->co_weakreflist != NULL) {
Expand Down
2 changes: 2 additions & 0 deletions Objects/frameobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -651,6 +651,8 @@ add_load_fast_null_checks(PyCodeObject *co)
Py_CLEAR(co->_co_cached->_co_cellvars);
Py_CLEAR(co->_co_cached->_co_freevars);
Py_CLEAR(co->_co_cached->_co_varnames);
PyMem_Free(co->_co_cached);
co->_co_cached = NULL;
}
}

Expand Down