[erlang-questions] hmac sha256 erlang

Robert Virding robert.virding@REDACTED
Sun May 8 23:42:59 CEST 2011


In the docs for binary:copy it says:

"This function will always create a new binary, even if N = 1. By using copy/1 on a binary referencing a larger binary, one might free up the larger binary for garbage collection."

Although there is a caveat saying that it might be actually useful in special cases.

Robert

----- "Steve Davis" <steven.charles.davis@REDACTED> wrote:

> Maybe not but in this case it seems marginally faster and I can't see
> any other impact?
> 
> I'm definitely open to correction/enlightenment, but I don't see why
> not here!
> 
> /s
> 
> On May 6, 4:43 pm, Robert Virding <robert.vird...@REDACTED
> solutions.com> wrote:
> > Why would you want to do binary:copy here? It is not what it is
> intended for.
> >
> > Robert
> >
> > ----- "Steve Davis" <steven.charles.da...@REDACTED> wrote:
> >
> > > ...though now I would favor binary:copy instead of
> > > list_to_binary(lists:duplicate()), but that depends on what OTP
> > > version you have...
> >
> > > /s
> > > _______________________________________________
> > > erlang-questions mailing list
> > > erlang-questi...@REDACTED
> > >http://erlang.org/mailman/listinfo/erlang-questions
> >
> > _______________________________________________
> > erlang-questions mailing list
> >
> erlang-questi...@REDACTED://erlang.org/mailman/listinfo/erlang-questions
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions



More information about the erlang-questions mailing list