blaise/runtime
Graeme Geldenhuys 043602a0a4 fix(arc): eliminate double-AddRef on function-return class assignments
Three fixes that work together to correct ARC refcount accounting:

1. _ClassFree now delegates to _ClassRelease instead of bypassing ARC
   with a raw _BlaiseFreeMem.  This lets users call .Free (out of habit)
   or rely on ARC — both paths go through the same refcount logic.

2. ExprOwnsRef helper in codegen suppresses the call-site _ClassAddRef
   when the RHS expression already owns a +1 reference (function/method
   return values).  Covers TFuncCallExpr (with ResolvedDecl guard to
   exclude type casts), TMethodCallExpr, TFieldAccessExpr.IsMethodCall,
   and TIdentExpr.IsNoArgFuncCall / IsImplicitSelfMethod.

3. Allow Pointer() and PtrUInt() casts on tyString arguments, needed by
   rtl.platform.posix for Pointer(APath) where APath is a string.

The double-AddRef bug inflated refcounts on every class-returning
function call: the callee's Result := X emitted AddRef (correct — the
Result slot is not released at scope exit), and the caller's assignment
emitted a second AddRef (incorrect — the +1 already transferred).
2026-06-01 23:49:39 +01:00
..
src fix(arc): eliminate double-AddRef on function-return class assignments 2026-06-01 23:49:39 +01:00
Makefile build(runtime): enable pipefail so compiler errors fail the build 2026-05-22 15:39:08 +01:00
project.xml refactor: split rtl/ into runtime/ + stdlib/, rename bcl.testing to blaise.testing 2026-05-16 00:51:18 +01:00