重置上传,新增了多个标准库,开始 TransPyV 自举实验
This commit is contained in:
@@ -71,9 +71,13 @@ def mbuddy_main() -> CInt:
|
||||
# === calloc 测试 (验证清零) ===
|
||||
testcheck.section("calloc 清零")
|
||||
arena2: bytes = stdlib.malloc(4096)
|
||||
viperlib.snprintf(buf, 256, "arena2 = %p", arena2)
|
||||
testcheck.info(buf)
|
||||
bd2: memhub.MemBuddy | CPtr = memhub.MemBuddy(arena2, 4096)
|
||||
|
||||
dirty: bytes = bd2.alloc(64)
|
||||
viperlib.snprintf(buf, 256, "dirty = %p", dirty)
|
||||
testcheck.info(buf)
|
||||
d_c: CUInt8T | CPtr = CPtr(dirty)
|
||||
i: CInt
|
||||
for i in range(64):
|
||||
@@ -81,6 +85,8 @@ def mbuddy_main() -> CInt:
|
||||
bd2.free(dirty)
|
||||
|
||||
cl: bytes = bd2.calloc(8, 8)
|
||||
viperlib.snprintf(buf, 256, "cl = %p (arena2=%p, dirty was=%p)", cl, arena2, dirty)
|
||||
testcheck.info(buf)
|
||||
if cl != None:
|
||||
cl_c: CUInt8T | CPtr = CPtr(cl)
|
||||
all_zero: CInt = 1
|
||||
|
||||
Reference in New Issue
Block a user