[erlang-questions] Preallocated binary — save memory

Max Lapshin max.lapshin@REDACTED
Thu Apr 11 13:38:01 CEST 2013


I've made following:

{function, bin, 1, 2}.
  {label,1}.
    {line,[{location,"alloc.erl",4}]}.
    {func_info,{atom,alloc},{atom,bin},1}.
  {label,2}.
    {line,[{location,"alloc.erl",5}]}.
    bs_init_writable.
    return.


It shows excelent results on syntetic tests, but when I run real code,
binary doesn't remain the same, but I'm only appending.

Perhaps, this zerocopy magic will work only if compiler generates
bs_private_append instructions?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20130411/4667dc52/attachment.htm>


More information about the erlang-questions mailing list