diff --git a/App/lib/core/Gen/AssignGenMixin.vp b/App/lib/core/Gen/AssignGenMixin.vp index 424f376..2a208fa 100644 --- a/App/lib/core/Gen/AssignGenMixin.vp +++ b/App/lib/core/Gen/AssignGenMixin.vp @@ -575,8 +575,8 @@ novirtual class AssignGenMixin: if ta is None or tb is None: return 0 # Fast path: identical instance is equal if uint64(ta) == uint64(tb): return 1 - buf_a: str = pool.alloc(4096) - buf_b: str = pool.alloc(4096) + buf_a: str = pool.alloc_tagged(4096, memhub.DETSITE_ASSIGNGEN_578) + buf_b: str = pool.alloc_tagged(4096, memhub.DETSITE_ASSIGNGEN_579) if buf_a is None or buf_b is None: return 0 mlirlite.TypePrint(buf_a, 4096, ta, pool) mlirlite.TypePrint(buf_b, 4096, tb, pool) diff --git a/App/lib/core/Gen/Call/CallGenCBuiltin.vp b/App/lib/core/Gen/Call/CallGenCBuiltin.vp index 0930306..a992681 100644 --- a/App/lib/core/Gen/Call/CallGenCBuiltin.vp +++ b/App/lib/core/Gen/Call/CallGenCBuiltin.vp @@ -1147,7 +1147,7 @@ novirtual class CallGenCBuiltin(CallGenBase.CallGenBase): first_arg = 0 # Type text - ty_buf: str = pool.alloc(4096) + ty_buf: str = pool.alloc_tagged(4096, memhub.DETSITE_CALLGENCBUILTIN_1150) if ty_buf is not None: ty_buf[0] = '\0' mlirlite.TypePrint(ty_buf, 4096, aval.Ty, pool) @@ -1173,7 +1173,7 @@ novirtual class CallGenCBuiltin(CallGenBase.CallGenBase): builder.Counter += 1 # Get the return type text - ret_ty_buf: str = pool.alloc(4096) + ret_ty_buf: str = pool.alloc_tagged(4096, memhub.DETSITE_CALLGENCBUILTIN_1176) if ret_ty_buf is not None: ret_ty_buf[0] = '\0' mlirlite.TypePrint(ret_ty_buf, 4096, ret_ty, pool) diff --git a/App/lib/core/Gen/Call/CallGenLeafKit.vp b/App/lib/core/Gen/Call/CallGenLeafKit.vp index 20ea4f0..3d9db46 100644 --- a/App/lib/core/Gen/Call/CallGenLeafKit.vp +++ b/App/lib/core/Gen/Call/CallGenLeafKit.vp @@ -536,7 +536,7 @@ novirtual class CallGenLeafKit(CallGenCBuiltin.CallGenCBuiltin): cap: int = CallGenBase.MAX_FUNC_PTR_SIGS ret_str: str = "?" if ret_ty is not None: - typed_buf: str = pool.alloc(4096) + typed_buf: str = pool.alloc_tagged(4096, memhub.DETSITE_LEAFKIT_539) if typed_buf is not None: mlirlite.TypePrint(typed_buf, 4096, ret_ty, pool) if typed_buf[0] != '\0': ret_str = typed_buf diff --git a/App/lib/core/Gen/Class/ClassGenVTable.vp b/App/lib/core/Gen/Class/ClassGenVTable.vp index 263d641..113f3a8 100644 --- a/App/lib/core/Gen/Class/ClassGenVTable.vp +++ b/App/lib/core/Gen/Class/ClassGenVTable.vp @@ -816,7 +816,7 @@ novirtual class ClassGenVTable(ClassGenBase.ClassGenBase): else: # fail-fast: has a -> annotation but control truly falls off the end (traceback-style). if ret_ty is not None: - rt_name_m: str = pool.alloc(4096) + rt_name_m: str = pool.alloc_tagged(4096, memhub.DETSITE_CLASSGENVTABLE_819) if rt_name_m is not None: mlirlite.TypePrint(rt_name_m, 4096, ret_ty, pool) if rt_name_m[0] == '\0': rt_name_m = "?" diff --git a/App/lib/core/Gen/Expr/ExprGenBase.vp b/App/lib/core/Gen/Expr/ExprGenBase.vp index 372929a..17556e1 100644 --- a/App/lib/core/Gen/Expr/ExprGenBase.vp +++ b/App/lib/core/Gen/Expr/ExprGenBase.vp @@ -412,7 +412,7 @@ novirtual class ExprGenBase: def _type_text(self, pool: memhub.MemBuddy*, ty: mlirlite.LLVMType*) -> str: """Readable LLVM type text via TypePrint; "?" on failure.""" if ty is None: return "?" - buf: str = pool.alloc(4096) + buf: str = pool.alloc_tagged(4096, memhub.DETSITE_EXPRGENBASE_415) if buf is None: return "?" mlirlite.TypePrint(buf, 4096, ty, pool) if buf[0] == 0: return "?" diff --git a/App/lib/core/Gen/Expr/ExprGenCdef.vp b/App/lib/core/Gen/Expr/ExprGenCdef.vp index 34e188d..86e60f4 100644 --- a/App/lib/core/Gen/Expr/ExprGenCdef.vp +++ b/App/lib/core/Gen/Expr/ExprGenCdef.vp @@ -260,7 +260,7 @@ novirtual class ExprGenCdef(ExprGenBase.ExprGenBase): if src_path is None: # SHA1 absent from the store = compiler bug (Phase1/Phase2 not populated): # report and abort instead of silently returning -1 (avoids bad @UNDEFINED refs). - err_buf: str = pool.alloc(4096) + err_buf: str = pool.alloc_tagged(4096, memhub.DETSITE_EXPRGENCDEF_263) if err_buf is not None: viperlib.snprintf(err_buf, 512, "cross-module CDefine lookup failed: SHA1 %s is not in the store (base_mod=%s name=%s). " "Phase1/Phase2 did not correctly populate PopulateSha1MapStore/AppendToSha1MapStore", sha1, base_mod, name) VLogger.error(err_buf, "XMOD-CD") diff --git a/App/lib/core/Gen/Expr/ExprGenOps.vp b/App/lib/core/Gen/Expr/ExprGenOps.vp index a95a7a1..0e6b8b6 100644 --- a/App/lib/core/Gen/Expr/ExprGenOps.vp +++ b/App/lib/core/Gen/Expr/ExprGenOps.vp @@ -497,8 +497,8 @@ novirtual class ExprGenOps(ExprGenBase.ExprGenBase): rhs_is_ptr_now: int = self.is_ptr_type(rhs.Ty) if lhs_is_ptr_now != 0 and rhs_is_ptr_now != 0: # Both are pointers; compare type strings via TypePrint - lhs_ty_buf: str = pool.alloc(4096) - rhs_ty_buf: str = pool.alloc(4096) + lhs_ty_buf: str = pool.alloc_tagged(4096, memhub.DETSITE_EXPRGENOPS_500) + rhs_ty_buf: str = pool.alloc_tagged(4096, memhub.DETSITE_EXPRGENOPS_501) if lhs_ty_buf is not None and rhs_ty_buf is not None: mlirlite.TypePrint(lhs_ty_buf, 4096, lhs.Ty, pool) mlirlite.TypePrint(rhs_ty_buf, 4096, rhs.Ty, pool) @@ -1056,8 +1056,8 @@ novirtual class ExprGenOps(ExprGenBase.ExprGenBase): # Augmented assignment: build the "+=" form with an f-string (this language's str has no `+` concatenation). op_lbl = f"{op_ch}=" aug_note = "(augmented assignment)" - lty_buf: str = pool.alloc(4096) - rty_buf: str = pool.alloc(4096) + lty_buf: str = pool.alloc_tagged(4096, memhub.DETSITE_EXPRGENOPS_1059) + rty_buf: str = pool.alloc_tagged(4096, memhub.DETSITE_EXPRGENOPS_1060) lty_lbl: str = "?" rty_lbl: str = "?" if lty_buf is not None: diff --git a/App/lib/core/Gen/Func/FuncGenDef.vp b/App/lib/core/Gen/Func/FuncGenDef.vp index 1d1125a..3196f26 100644 --- a/App/lib/core/Gen/Func/FuncGenDef.vp +++ b/App/lib/core/Gen/Func/FuncGenDef.vp @@ -789,7 +789,7 @@ novirtual class FuncGenDef(CallGenBase.CallGenBase): if ret_ty is not None: # mlirlite has no type_get_name API; serialize the type with the real interface # TypePrint(buf, size, ty, pool). - rt_name: str = pool.alloc(4096) + rt_name: str = pool.alloc_tagged(4096, memhub.DETSITE_FUNCGENDEF_792) if rt_name is not None: mlirlite.TypePrint(rt_name, 4096, ret_ty, pool) if rt_name[0] == '\0': rt_name = "?" diff --git a/App/lib/core/Gen/Type/TypeGenCType.vp b/App/lib/core/Gen/Type/TypeGenCType.vp index cea7745..8e8b425 100644 --- a/App/lib/core/Gen/Type/TypeGenCType.vp +++ b/App/lib/core/Gen/Type/TypeGenCType.vp @@ -422,7 +422,7 @@ class TypeGenCType(TypeGenBase.TypeGenBase): # line parse buffer ("NAME\0VALUE\0"), reused per file (register_ctypedef copies). # 512 (not 320): _parse_typedef_line normalizes a C-style RHS (`const T` / `T*`) into # the longer canonical `|` union text, so the VALUE area must hold the expanded form. - td_buf: str = pool.alloc(4096) + td_buf: str = pool.alloc_tagged(4096, memhub.DETSITE_TYPEGENCTYPE_425) for i in range(src_len + 1): if i == src_len or src[i] == '\n': line_len: sizet = i - line_start diff --git a/App/lib/core/Gen/Type/TypeGenResolve.vp b/App/lib/core/Gen/Type/TypeGenResolve.vp index fa56f2c..2533927 100644 --- a/App/lib/core/Gen/Type/TypeGenResolve.vp +++ b/App/lib/core/Gen/Type/TypeGenResolve.vp @@ -557,7 +557,7 @@ novirtual class TypeGenResolve(TypeGenBase.TypeGenBase): # 4) Symbol-name truth: the struct's own IR name is "{module SHA1}.{Class}" # (same mangling as everywhere), so recover the SHA1 from the type name. if _def_sha1 is None and _bare_entry is not None and _bare_entry.Ty is not None: - _tp_buf: str = pool.alloc(4096) + _tp_buf: str = pool.alloc_tagged(4096, memhub.DETSITE_TYPEGENRESOLVE_560) if _tp_buf is not None: _tp_buf[0] = '\0' mlirlite.TypePrint(_tp_buf, 4096, _bare_entry.Ty, pool) @@ -607,7 +607,7 @@ novirtual class TypeGenResolve(TypeGenBase.TypeGenBase): if _bare_entry is not None: _w_ep = 1 _w_ty: str = "None" if _bare_entry is not None and _bare_entry.Ty is not None: - _w_buf: str = pool.alloc(4096) + _w_buf: str = pool.alloc_tagged(4096, memhub.DETSITE_TYPEGENRESOLVE_610) if _w_buf is not None: _w_buf[0] = '\0' mlirlite.TypePrint(_w_buf, 4096, _bare_entry.Ty, pool)