mirror of
https://github.com/pocketpy/pocketpy
synced 2025-10-20 11:30:18 +00:00
some optimize
This commit is contained in:
parent
ede1b458f1
commit
c6473661dd
@ -122,17 +122,6 @@ struct PyObject{
|
||||
}
|
||||
};
|
||||
|
||||
struct PySignalObject: PyObject {
|
||||
PySignalObject() : PyObject(0) {
|
||||
gc_enabled = false;
|
||||
}
|
||||
void _obj_gc_mark() override {}
|
||||
};
|
||||
|
||||
inline PyObject* const PY_NULL = new PySignalObject();
|
||||
inline PyObject* const PY_OP_CALL = new PySignalObject();
|
||||
inline PyObject* const PY_OP_YIELD = new PySignalObject();
|
||||
|
||||
const int kTpIntIndex = 2;
|
||||
const int kTpFloatIndex = 3;
|
||||
|
||||
@ -349,4 +338,8 @@ struct Py_<DummyModule> final: PyObject {
|
||||
void _obj_gc_mark() override {}
|
||||
};
|
||||
|
||||
extern PyObject* const PY_NULL;
|
||||
extern PyObject* const PY_OP_CALL;
|
||||
extern PyObject* const PY_OP_YIELD;
|
||||
|
||||
} // namespace pkpy
|
@ -23,4 +23,8 @@ namespace pkpy{
|
||||
this->argc = -1;
|
||||
this->decl = decl;
|
||||
}
|
||||
|
||||
PyObject* const PY_NULL = (PyObject*)new int(0);
|
||||
PyObject* const PY_OP_CALL = (PyObject*)new int(1);
|
||||
PyObject* const PY_OP_YIELD = (PyObject*)new int(2);
|
||||
} // namespace pkpy
|
Loading…
x
Reference in New Issue
Block a user