Ivan FB a6b22fc6df
fix: set up foreign-thread GC in event-listener entry points
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>
2026-06-19 23:26:43 +02:00
..
2026-05-20 14:14:42 -03:00
2026-05-16 01:08:42 +02:00
2026-05-08 14:14:16 -03:00