[erlang-questions] Are binaries relocatable?
Thu Aug 28 15:09:57 CEST 2014
I would like to know if binaries are relocatable. If I have binary parameter
if (!enif_inspect_binary(env, argv, &bin))
I store binary in mine own environment
ErlNifEnv *priv_env = enif_alloc_env();
Can I then rely on bin.data pointing into same memory until I free
enif_free_env(priv_env) ? I'm asking because I would like to avoid copying
and share data or even return it using enif_make_resource_binary to catch
I have code which makes copy of binary data but when I switch to reference
bin.data it hangs whole VM. I would like to know if I make some mistake in
mine code and it should work or it is wrong idea at all.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the erlang-questions