Ivan FB 85931bad92
fix(macro): avoid caller-thread GC alloc in ffiNewReq
ffiNewReq derived the request id with `let typeStr = $T`, allocating a
Nim GC string on the *calling* thread for every request. Embedded in a
foreign host (e.g. Go) the callers are transient, concurrent OS threads;
running Nim's GC there corrupts the heap under load. The type name is
known at compile time, so emit it as a `cstring` literal (the same value
already used as the registry key) — no runtime allocation. Applies to
both the {.ffi.} and {.ffiCtor.} request builders.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-18 20:09:40 +02:00
..