fix: implement complete RC memory safety in C backend

- Add magic number system (LUX_RC_MAGIC) to distinguish RC-managed
  allocations from static string literals, preventing crashes on decref
- Convert string helpers (trim, lines, split) to use lux_rc_alloc
- Track inline RC temps from effect operations (Process.exec, File.read,
  Console.readLine, Http ops, String ops) by creating temp variables
- Implement ownership transfer: when RC temp is bound to a variable,
  unregister temp and only track bound variable to avoid double-free
- Result: grapho runs with 0 memory leaks

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-02-15 03:53:42 -05:00
parent 38bf825134
commit f33ea5f7f7

File diff suppressed because it is too large Load Diff