lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Fortunately, no. Lua strings are immutable and reference-counted.
Short strings get interned into a pool so that they're represented
application-wide by a simple numeric value, and longer strings are
shared instead of copied until they're garbage-collected.

/s/ Adam

On Wed, Nov 7, 2012 at 12:40 PM, cynthia powers <powcyn@gmail.com> wrote:
> specifically, when you have a string argument to a function, at the call,
> does lua make a separate copy of the string object?
>
>
> On ed, Nov 7, 2012 at 2:46 PM, cynthia powers <powcyn@gmail.com> wrote:
>>
>> How is copy-by-value implemented for lua strings?
>> Is there a new TObject made in every SETGLOBAL of the string object inside
>> the function?
>
>