Hello, <br><br>There is code as example:<br><a href="https://github.com/beerriot/icu4e/blob/master/c_src/ustring.c">https://github.com/beerriot/icu4e/blob/master/c_src/ustring.c</a><br clear="all"><br>I have few questions:<br>
1. How long is env's lifetime in the load(...)? Will the env be erased after the call or after module unloading?<br>2. Is this code valid?<br><pre><div class="line" id="LC74"><span class="n">ERL_NIF_TERM</span> <span class="nf">ustring_endian</span><span class="p">(</span><span class="n">ErlNifEnv</span><span class="o">*</span> <span class="n">env</span><span class="p">,</span> <span class="kt">int</span> <span class="n">argc</span><span class="p">,</span></div>
<div class="line" id="LC75"> <span class="k">const</span> <span class="n">ERL_NIF_TERM</span> <span class="n">argv</span><span class="p">[])</span> <span class="p">{</span></div><div class="line" id="LC76">
<span class="k">return</span> <span class="n">ATOM_ENDIAN</span><span class="p">;</span></div><div class="line" id="LC77"><span class="p">}</span></div></pre>Is the next construction better?<br><br>return enif_make_copy(env, ATOM_ENDIAN);<br>