[erlang-questions] Update on sharing constant data locally by reference rather than by copy?

Matthew Dempsky <>
Sun Mar 29 19:41:42 CEST 2009


On Sat, Mar 28, 2009 at 12:21 AM, Bjorn Gustavsson
<> wrote:
> On Sat, Mar 28, 2009 at 4:08 AM, Matthew Dempsky <> wrote:
>> You're talking about current Erlang releases, right?  How does that
>> work with module reloading?  E.g., if foo:bar/0 returns a constant
>> complex data structure and the result is not copied into the calling
>> process's private heap, what happens when a module is purged while a
>> process is still holding onto a reference to the data structure?
>
> The data will be copied to the heap of each process that has a reference
> to the data before the module is purged.

Awesome, I just experimentally confirmed this is the resulting
behavior too.  Thanks!



More information about the erlang-questions mailing list