diff --git a/include/pocketpy/obj.h b/include/pocketpy/obj.h index fe549698..bf4f7968 100644 --- a/include/pocketpy/obj.h +++ b/include/pocketpy/obj.h @@ -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_ 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 \ No newline at end of file diff --git a/src/codeobject.cpp b/src/codeobject.cpp index ef156c18..6185c8d0 100644 --- a/src/codeobject.cpp +++ b/src/codeobject.cpp @@ -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 \ No newline at end of file