enif_send, terms and msg_env
Thu Sep 17 10:28:57 CEST 2020
>> The message environment msg_env with all its terms (including msg) is
>> invalidated by a successful call to enif_send.
> I have created msg in another environment and I do not want to invalidate
> Should I just prefer using NULL for msg_env in this case?
Yes. With msg_env==NULL the message will be copied to the receiver. With
msg_env!=NULL the message will be handed over to the receiver together will
any other terms in msg_env which will become garbage.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 5509 bytes
Desc: not available
More information about the erlang-questions