[erlang-questions] ErlNifPid question
Mon Jul 18 14:36:58 CEST 2016
On Mon, Jul 18, 2016 at 7:14 AM, Caragea Silviu <silviu.cpp@REDACTED>
> Hello having two ErlNifPid how I can compare them to know if they refer to
> the same PID or not ?
> Other than avoiding calling enif_make_pid like:
> enif_is_identical(enif_make_pid(env, &pid1), enif_make_pid(env, &pid2))
This is the right way to do it. ErlNifPid is a struct with a term member
but is documented to be an opaque type, so you're not supposed to access
its term directly. But note that enif_make_pid is a C macro that does
exactly that, so there's no function call overhead from using it.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the erlang-questions