Silly Erlang/Elixir beam question.

If I have a module like so:

defmodule Foo do
  @data %{:foo => "foo", :bar => "bar"}

  def getData(), do: @data
end

spawn fn() ->
  x = Foo.getData()
  # Do something with x
  :timer.sleep(100000)
end

spawn fn()->
  x = Foo.getData()
  # Do something with x
  :timer.sleep(100000)
end


How many copies of 

%{:foo => "foo", :bar => "bar"}

are there in memory?  Does each process make a copy of the data in it's 
stack or do both process point to the same copy in some code space, etc.

Thanks!

-Chris

-- 
You received this message because you are subscribed to the Google Groups 
"elixir-lang-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elixir-lang-core/8759b998-e32a-4b9e-9e23-ab8c213c4524%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to