<div dir="ltr">Thanks Richard, for the clarification. Yes - I was referring to interprocess communication..<div><br></div><div>Regards,</div><div>Theepan</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jan 25, 2016 at 5:08 AM, Richard A. O'Keefe <span dir="ltr"><<a href="mailto:ok@cs.otago.ac.nz" target="_blank">ok@cs.otago.ac.nz</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class=""><br>
On 24/01/2016, at 9:23 am, Theepan <<a href="mailto:vasdeveloper@gmail.com">vasdeveloper@gmail.com</a>> wrote:<br>
> If I add the same binary data to different lists, will it be copied? I know for a fact that binary data are referenced, but not sure in list making case.<br>
<br>
</span>Suppose you have this code:<br>
<br>
   X = ...any arbitrary Erlang term...<br>
   P = ...any list you like...<br>
   Q = ...any other list you like...<br>
   P1 = [X|P],<br>
   Q1 = Q ++ [X]<br>
<br>
X is not copied, no matter what it is, no matter how small,<br>
no matter how big.  Making P1 copies nothing, just creates<br>
one new pair.  Making Q1 copies the spine of Q, but not the<br>
elements of Q, and not X.<br>
<br>
You are probably thinking about the fact that<br>
large binaries are *not* copied when they are<br>
sent to another process, and that they are<br>
reference counted for that purpose.<br>
<br>
<br>
<br>
<br>
<br>
</blockquote></div><br></div>