snapshot before regression test
This commit is contained in:
27
TransPyV/App/lib/__init__.py
Normal file
27
TransPyV/App/lib/__init__.py
Normal file
@@ -0,0 +1,27 @@
|
||||
import t, c
|
||||
from stdint import *
|
||||
import memhub
|
||||
import lib.core.VLogger as VLogger
|
||||
|
||||
|
||||
# ============================================================
|
||||
# lib 包入口 - 声明全局 _mbuddy 内存池指针
|
||||
# ============================================================
|
||||
|
||||
# 全局 mbuddy 内存池指针(由 App/main.py 初始化后注入)
|
||||
_mbuddy: memhub.MemManager | t.CPtr
|
||||
|
||||
|
||||
def InitLib(mb: memhub.MemManager | t.CPtr) -> int:
|
||||
"""初始化 lib 包的全局 _mbuddy 指针,并级联注入到所有子模块。
|
||||
|
||||
Args:
|
||||
mb: memhub.MemManager 实例指针(MemBuddy 等子类通过多态传入)
|
||||
|
||||
Returns:
|
||||
0 表示成功,非 0 表示失败
|
||||
"""
|
||||
if mb is None:
|
||||
return 1
|
||||
VLogger._mbuddy = mb
|
||||
return 0
|
||||
Reference in New Issue
Block a user