lua-users home
lua-l archive

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


The static strings would be useful as well, but I mainly was wanting
to have only one copy of the byte code in memory per VM,

On Thu, Oct 19, 2023 at 11:16 AM Roberto Ierusalimschy
<roberto@inf.puc-rio.br> wrote:
>
> > There are a few things it'd be nice to be able to tell stock Lua are
> > static data it doesn't need to take a RAM copy of. C string literals
> > are another example, although caveat emptor would have to apply, as of
> > course even static data can stop being accessible if the code segment
> > is unloaded.
>
> It is not difficult to have in Lua a kind of 'lua_pushliteral' for
> static strings, provided the string is "long" (at least 40 bytes).
> My question is, would that be useful? If an application is written to be
> small, would it have any significant number of long (or a few really
> long) strings?
>
> -- Roberto