refactor(tpv): rowptr[T] 迁移 + D 表定长缓冲改精确分配 + SHA1 前缀判定收敛(D1/D3/D4/D5/D6/D7/C10)
This commit is contained in:
1 parent
7471cc64f9
commit
82eea2719f
66 files changed
+2709
-2604
No files matched your search
@@ -17,7 +17,7 @@ import string
|
||||
# ============================================================
|
||||
|
||||
# 内存池(测试内部使用)
|
||||
_mbuddy: memhub.MemBuddy | t.CPtr
|
||||
_mbuddy: rowptr[memhub.MemBuddy]
|
||||
|
||||
# 测试用内存大小(64KB,足够构造 LLVMType 值)
|
||||
_NMATCH_POOL_SIZE: t.CDefine = 65536
|
||||
@@ -32,7 +32,7 @@ def _init_mbuddy() -> int:
|
||||
if arena is None:
|
||||
stdio.printf("FAIL: malloc for arena failed\n")
|
||||
return 1
|
||||
mb: memhub.MemBuddy | t.CPtr = stdlib.malloc(memhub.MemBuddy.__sizeof__())
|
||||
mb: rowptr[memhub.MemBuddy] = stdlib.malloc(memhub.MemBuddy.__sizeof__())
|
||||
stdio.printf("[DBG] _init_mbuddy: malloc mb=%d\n", mb is None)
|
||||
if mb is None:
|
||||
stdio.printf("FAIL: MemBuddy init failed\n")
|
||||
|
||||
@@ -14,7 +14,7 @@ def main() -> int:
|
||||
arena: bytes = stdlib.malloc(POOL_SIZE)
|
||||
if arena is None:
|
||||
return 1
|
||||
mb: memhub.MemBuddy | t.CPtr = memhub.MemBuddy(arena, POOL_SIZE)
|
||||
mb: rowptr[memhub.MemBuddy] = memhub.MemBuddy(arena, POOL_SIZE)
|
||||
if mb is None:
|
||||
return 1
|
||||
hashlib._mbuddy = (memhub.MemManager | t.CPtr)(mb)
|
||||
|
||||
Reference in new issue
Block a user