[erlang-questions] Preallocated binary — save memory

Max Lapshin <>
Wed Apr 10 22:50:12 CEST 2013

I've looked at erlc -S bc.erl:

{function, bc, 1, 2}.

It is really cool!  Erlang understands that resulting binary will be
exactly 45 * (size(Input) div 42) bytes and preallocates it.
This is a very important reason to use list and binary comprehensions.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20130411/a69e7f5d/attachment.html>

More information about the erlang-questions mailing list