osmaczko 1f8c38d2ce
fix(nim-bindings): fix ABI mismatch in destroy_* FFI functions and add defer-based cleanup
Nim's C backend silently transforms large struct parameters (>16 bytes) into
pointer parameters when calling importc functions. The destroy_* functions were
declared taking T by value in Rust, but Nim always passed &T — causing Rust to
read garbage from the stack on x86-64 (SIGILL on CI) while accidentally working
on ARM64 macOS due to that ABI coincidentally also using pointers for large structs.

Fix by changing all destroy_* functions to take &mut T and using drop_in_place,
which is the correct idiom for dropping a value through a pointer.

On the Nim side, replace scattered manual destroy calls with defer, which
guarantees cleanup on all exit paths and prevents use-after-destroy bugs.
2026-02-25 20:03:09 +01:00
2026-02-24 15:28:02 -08:00
2026-02-18 09:29:33 -08:00
2026-02-10 19:45:00 +01:00
2026-02-10 19:45:00 +01:00
2026-02-10 14:40:01 +01:00
2026-02-22 08:24:10 +02:00
2026-01-30 15:46:36 +00:00
2025-12-20 22:34:08 -08:00

libchat

Supporting library for Logos-chat

Description
Supporting library for Logos-chat
Readme
Languages
Rust 85.2%
Nim 13.5%
C 1.3%