mirror of
https://github.com/python/cpython.git
synced 2025-07-09 20:35:26 +00:00
GH-104584: Plugin optimizer API (GH-105100)
This commit is contained in:
parent
601ae09f0c
commit
4bfa01b9d9
31 changed files with 950 additions and 501 deletions
|
@ -433,6 +433,7 @@ init_code(PyCodeObject *co, struct _PyCodeConstructor *con)
|
|||
co->co_weakreflist = NULL;
|
||||
co->co_extra = NULL;
|
||||
co->_co_cached = NULL;
|
||||
co->co_executors = NULL;
|
||||
|
||||
memcpy(_PyCode_CODE(co), PyBytes_AS_STRING(con->code),
|
||||
PyBytes_GET_SIZE(con->code));
|
||||
|
@ -1677,6 +1678,12 @@ code_dealloc(PyCodeObject *co)
|
|||
|
||||
PyMem_Free(co_extra);
|
||||
}
|
||||
if (co->co_executors != NULL) {
|
||||
for (int i = 0; i < co->co_executors->size; i++) {
|
||||
Py_CLEAR(co->co_executors->executors[i]);
|
||||
}
|
||||
PyMem_Free(co->co_executors);
|
||||
}
|
||||
|
||||
Py_XDECREF(co->co_consts);
|
||||
Py_XDECREF(co->co_names);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue