lua-users home
lua-l archive

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

----- Original Message -----
> What is the lifetime of the string passed to dosomething()? Will it
> eventually be garbage-collected sometime after dosomething() has
> returned? So, would dosomething() have to make a copy of the string?

It only lives in your function - So yes you must make a copy and store it
somewhere safe :-)