lua-users home
lua-l archive

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


On 03/23/2012 01:17 AM, Petri Häkkinen wrote:
> Would this mean that long strings are no longer shared in memory? I.e. could there be several copies of the same long string in memory? If so, this could increase memory consumption of certain applications considerably and could be a problem for games and embedded systems.

The answer to this would interest me too, if it hasn't been said yet.
I would hope that basic copy-on-write behavior would apply, i.e. that
with long strings  a=b  means that the a and b pointers are the same
until some modification of b takes place via string.format, string.gsub,
the concat operator, etc.