summaryrefslogtreecommitdiffstats
path: root/Include
diff options
context:
space:
mode:
authorMark Shannon <mark@hotpy.org>2023-06-05 08:44:23 (GMT)
committerGitHub <noreply@github.com>2023-06-05 08:44:23 (GMT)
commite8ecb9ee6bec03d0c4490f3e7f1524e56e2f6a0f (patch)
tree5d88f25105eb2d0dc9fe5034ac9257e2da86db8e /Include
parent9efaff5fd31a55e3beaa1fa430058de36a145566 (diff)
downloadcpython-e8ecb9ee6bec03d0c4490f3e7f1524e56e2f6a0f.zip
cpython-e8ecb9ee6bec03d0c4490f3e7f1524e56e2f6a0f.tar.gz
cpython-e8ecb9ee6bec03d0c4490f3e7f1524e56e2f6a0f.tar.bz2
GH-104584: Allow optimizers to opt out of optimizing. (GH-105244)
Diffstat (limited to 'Include')
-rw-r--r--Include/cpython/optimizer.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/Include/cpython/optimizer.h b/Include/cpython/optimizer.h
index eb257d7..b2d173f 100644
--- a/Include/cpython/optimizer.h
+++ b/Include/cpython/optimizer.h
@@ -21,7 +21,8 @@ typedef struct _PyExecutorObject {
typedef struct _PyOptimizerObject _PyOptimizerObject;
-typedef _PyExecutorObject *(*optimize_func)(_PyOptimizerObject* self, PyCodeObject *code, _Py_CODEUNIT *instr);
+/* Should return > 0 if a new executor is created. O if no executor is produced and < 0 if an error occurred. */
+typedef int (*optimize_func)(_PyOptimizerObject* self, PyCodeObject *code, _Py_CODEUNIT *instr, _PyExecutorObject **);
typedef struct _PyOptimizerObject {
PyObject_HEAD