mirror of
https://github.com/logos-messaging/nim-ffi.git
synced 2026-06-21 08:49:34 +00:00
Hammers one shared context from several threads, alternating the two ABIs of the same library: the native path (EchoRequest struct in, typed EchoResponse* back) and the CBOR path (encoded request in, CBOR map back), each verifying the echoed message round-trips. Exercises the POD deep-copy/free on the way in, the respPod deliver/free on the way out, and the request channel under contention. Run plain or with SAN=address / SAN=thread. Clean at 6 threads x 1500 iters (9000 calls per ABI) under both ASAN and TSAN — no leaks, use-after-free, or data races. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
nim-ffi
Allows exposing Nim projects to other languages
Example
examples/timer is now a self-contained Nimble project that imports nim-ffi directly.
Use cd examples/timer && nimble install -y ../.. && nimble build to compile the example.
Description
Languages
Nim
87.9%
Smarty
5.9%
C++
4.8%
CMake
1.4%