mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
gh-133395: add option for extension modules to specialize BINARY_OP/SUBSCR, apply to arrays (#133396)
This commit is contained in:
parent
07f416a3f0
commit
082dbf7788
14 changed files with 172 additions and 45 deletions
|
@ -482,13 +482,18 @@ adaptive_counter_backoff(_Py_BackoffCounter counter) {
|
|||
/* Specialization Extensions */
|
||||
|
||||
/* callbacks for an external specialization */
|
||||
typedef int (*binaryopguardfunc)(PyObject *lhs, PyObject *rhs);
|
||||
typedef PyObject *(*binaryopactionfunc)(PyObject *lhs, PyObject *rhs);
|
||||
|
||||
typedef struct {
|
||||
struct _PyBinopSpecializationDescr;
|
||||
|
||||
typedef int (*binaryopguardfunc)(PyObject *lhs, PyObject *rhs);
|
||||
typedef PyObject* (*binaryopactionfunc)(PyObject *lhs, PyObject *rhs);
|
||||
typedef void (*binaryopfreefunc)(struct _PyBinopSpecializationDescr *descr);
|
||||
|
||||
typedef struct _PyBinopSpecializationDescr {
|
||||
int oparg;
|
||||
binaryopguardfunc guard;
|
||||
binaryopactionfunc action;
|
||||
binaryopfreefunc free;
|
||||
} _PyBinaryOpSpecializationDescr;
|
||||
|
||||
/* Comparison bit masks. */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue