summaryrefslogtreecommitdiffstats
path: root/Objects/codeobject.c
diff options
context:
space:
mode:
Diffstat (limited to 'Objects/codeobject.c')
-rw-r--r--Objects/codeobject.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/Objects/codeobject.c b/Objects/codeobject.c
index a413b18..f983d66 100644
--- a/Objects/codeobject.c
+++ b/Objects/codeobject.c
@@ -1906,3 +1906,18 @@ _PyCode_ConstantKey(PyObject *op)
}
return key;
}
+
+void
+_PyStaticCode_Dealloc(PyCodeObject *co, _Py_CODEUNIT *firstinstr)
+{
+ PyMem_Free(co->co_quickened);
+ co->co_quickened = NULL;
+ PyMem_Free(co->co_extra);
+ co->co_extra = NULL;
+ co->co_firstinstr = firstinstr;
+ if (co->co_weakreflist != NULL) {
+ PyObject_ClearWeakRefs((PyObject *)co);
+ co->co_weakreflist = NULL;
+ }
+ co->co_warmup = QUICKENING_INITIAL_WARMUP_VALUE;
+}