News for hackers. Stuff that matters.
Re:Write Elixir NIFs in Rust by octacat on Monday August 07, 2023 @05:53PM (#37041467)
You can put your nif ref into a persistent term (if you do not plan to update it). Or into ETS table (which kinda defeats the purpose of making your own ETS table).

But probably you would wanna not use resources and pass name of a table as an atom into your C level.

Lifecycle is simple, the same lifecycle is as for long binaries. Each process that saw the reference would increase internal ref count. Once a process has been GC-d and does not have references to the resource in the process heap - the ref count decreases. When nobody references the resource - it is removed.

There are no comments on this comment yet.