From 0f543a2c96bcb3b75426feaf69c16b1df0cd76dd Mon Sep 17 00:00:00 2001 From: blueloveTH Date: Sat, 20 Apr 2024 12:19:41 +0800 Subject: [PATCH] Update codeobject.cpp --- src/codeobject.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/codeobject.cpp b/src/codeobject.cpp index 6185c8d0..c4e738a8 100644 --- a/src/codeobject.cpp +++ b/src/codeobject.cpp @@ -24,7 +24,12 @@ namespace pkpy{ 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); + struct PySignalObject: PyObject { + PySignalObject() : PyObject(0) { gc_enabled = false; } + void _obj_gc_mark() override {} + }; + + PyObject* const PY_NULL = new PySignalObject(); + PyObject* const PY_OP_CALL = new PySignalObject(); + PyObject* const PY_OP_YIELD = new PySignalObject(); } // namespace pkpy \ No newline at end of file