From 2fb386a4ff5469a94ac65c08fe6140a0e9b1c1ed Mon Sep 17 00:00:00 2001 From: TermiNexus Date: Fri, 7 Aug 2026 19:57:51 +0800 Subject: [PATCH] =?UTF-8?q?chore(core):=20=E7=A7=BB=E9=99=A4=20Phase1.vp?= =?UTF-8?q?=20=E9=81=97=E7=95=99=E7=9A=84=20DBG-MC=20=E8=B0=83=E8=AF=95?= =?UTF-8?q?=E8=BE=93=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- TestProject/App/main.vp | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/TestProject/App/main.vp b/TestProject/App/main.vp index c853563..ff705c1 100644 --- a/TestProject/App/main.vp +++ b/TestProject/App/main.vp @@ -1,12 +1,45 @@ import w32.win32console as w32cmd +from w32.win32console import SetConsoleOutputCP, SetConsoleCP +import stdlib +import memhub +import string import t, c pagecode: t.CDefine = 65001 +@c.Attribute(t.attr.packed) +class A: + a: int = 1 + def __init__(self): + self.a = 10 + + + + @t.CExport def main() -> int: w32cmd.SetConsoleOutputCP(pagecode) w32cmd.SetConsoleCP(pagecode) + SetConsoleOutputCP(pagecode) + SetConsoleCP(pagecode) print("你好,世界") + + p = stdlib.malloc(1024) + m = memhub.MemPool(p, 1024) + + a: A | t.CPtr = m.alloc(A.__sizeof__()) + string.memset(a, 0, A.__sizeof__()) + + string.memset(a, 0x00000002, A.__sizeof__()) + print(a.a) # 2 + + a.__before_init__() + print(a.a) # 1 + + a.__init__() + print(a.a) # 10 + + print("你好") + return 0