chore(core): 移除 Phase1.vp 遗留的 DBG-MC 调试输出
This commit is contained in:
1 parent
acc126ce0c
commit
2fb386a4ff
1 file changed
+33
@@ -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
|
||||
Reference in new issue
Block a user