Remix.run Logo
▲ ricardobeat 9 minutes ago

Ok, I had some time to kill :)

I made two new worktrees, hard reset to the commit preceding a simple fix. The issue: "temporary buffers (out_buf, cps, out_cps, src_cps) are manually freed across multiple return branches. Pairing each acquisition with defer mem::free(...) — or using @pool() + mem::temp_array for the short-lived out_buf / out_cps scratch arrays — removes the branch-by-branch cleanup".

---

## Round 1

Neon implements. ~6 minutes.

Opus reviews. 30s. Prompt is "review the unstaged changes", empty context.

- The heap_buf + defer if (heap_buf != null) combination is clunky, much like the committed flag was. C3 has a built-in way to do this [shows example]

- if no character actually changes, return the string itself to skip the buffer

- Allocator mismatch: unicode_normalize_simple in src/unicode_wrapper.c allocates with libc realloc, but result_cps is released with mem::free

All three accepted and fixed. This is an accurate re-enactment of what happened an hour ago with the same fix.

---

## Round 2

Opus implements. 2m44s.

Neon reviews. 4m30s.

"Looks good — no bugs or leaks introduced."