lua-users home
lua-l archive

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


>>>>> "Marc" == Marc Balmer <marc@msys.ch> writes:

 Marc> I somewhat agree. But the string copy is only used within my C
 Marc> function, so it does not really matter if it is modified, since
 Marc> Lua code never sees or uses this string. Therefore my question if
 Marc> this has any "technical" side/bad effects.

You can't know if lua code ever sees the string, because strings are
interned; there is only one copy of any given short string. So trying to
make a "copy" with lua_tolstring will actually just return the original
pointer for strings under a certain length.

-- 
Andrew.