mirror of
https://github.com/logos-messaging/nim-ffi.git
synced 2026-08-05 14:33:13 +00:00
sds_add_event_listener / sds_remove_event_listener run on the foreign caller thread and allocate Nim memory ($eventName, the listener registry Table+seq), but unlike the ctor/dtor they never called initializeLibrary. A foreign host (Go) migrates goroutines across OS threads, so the thread running add_event_listener may not be the one that ran a prior entry point; without setupForeignThreadGc its per-thread allocator region is uninitialised and the first Nim allocation faults in the allocator. 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.1%
Smarty
5.7%
C++
3%
C
2.1%
CMake
2.1%