some optimize

This commit is contained in:
blueloveTH 2024-04-20 12:13:15 +08:00
parent ede1b458f1
commit c6473661dd
2 changed files with 8 additions and 11 deletions

View File

@ -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 kTpIntIndex = 2;
const int kTpFloatIndex = 3; const int kTpFloatIndex = 3;
@ -349,4 +338,8 @@ struct Py_<DummyModule> final: PyObject {
void _obj_gc_mark() override {} void _obj_gc_mark() override {}
}; };
extern PyObject* const PY_NULL;
extern PyObject* const PY_OP_CALL;
extern PyObject* const PY_OP_YIELD;
} // namespace pkpy } // namespace pkpy

View File

@ -23,4 +23,8 @@ namespace pkpy{
this->argc = -1; this->argc = -1;
this->decl = decl; 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 } // namespace pkpy