<div dir="ltr">Here's a sequence I used to get deterministic resource destruction<div><br></div><div><a href="https://github.com/goertzenator/nifpp/blob/master/examples/nifpptest.erl#L215-L224">https://github.com/goertzenator/nifpp/blob/master/examples/nifpptest.erl#L215-L224</a></div><div><br></div><div>It's been a few years since I've run that however; there's a chance newer Erlangs might break it.<br><br><div class="gmail_quote"><div dir="ltr">On Fri, Jul 15, 2016 at 8:57 AM Roger Lipscombe <<a href="mailto:roger@differentpla.net">roger@differentpla.net</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Who owns NIF resources? When are they garbage collected? They don't<br>
seem to be owned by the erlang process that called into the NIF to<br>
allocate the resource, because they're not garbage collected when that<br>
process dies.<br>
<br>
Or, to look at it another way: how do I return a resource from a NIF,<br>
and have it destructed deterministically?<br>
_______________________________________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org" target="_blank">erlang-questions@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" rel="noreferrer" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
</blockquote></div></div></div>