[erlang-questions] Small and large (>=64B) binaries? How do they differ?

Frank Muller <>
Thu Sep 21 16:54:13 CEST 2017


Sverker,

Okay thanks for the clarifications.

How about the opposite: an Erlang process which holds pointers to a large
number of RefCounted
Bins ?

Is there any performance penalty (ex. affected by GC) of doing that?

/Frank




>
> On 09/20/2017 06:39 PM, Frank Muller wrote:
> > Thanks again Dmytro for your time.
> >
> > Let assume I’m inside my NIF and would like to increment the refcount of
> a
> > binary (hope this is the right call: enif_keep_resource).
> No, enif_keep_resource does not work on binaries.
> "Resources" are a concept of their own and binaries are not resources.
>
> Unfortunately there is no enif_keep_binary. The only use for such a
> function
> is if you want to keep binaries alive even no processes are referring to
> them.
> And you would need some native data structure with pointers to those
> binaries,
> in order to find them without a binary term.
>
> /Sverker
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20170921/227338fe/attachment.html>


More information about the erlang-questions mailing list