On Apr 5, 2014, at 9:57 AM, Rena <
hyperhacker@gmail.com> wrote:
>
> * It can copy any type except for Userdata (unless it has __xcopy) and Thread (as that makes
> no sense really). String copying is binary-safe (but maybe not terribly memory-efficient, since
> each Lua state will internally make a copy of the string). Tables are copied recursively (but
> there's nothing to prevent infinite recursion, so be careful of nested references). Functions can
> be copied, but they might not work as expected due to a lack of _ENV (this is something I
> still need to investigate and fix).
>
Be careful about table copying. Apart from the obvious issues with cyclical table references, you also need to deal with multiple references to the same table: