[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: static strings [was Re: Lua Compile/one time Load?]
- From: 云风 Cloud Wu <cloudwu@...>
- Date: Fri, 20 Oct 2023 14:12:31 +0800
Roberto Ierusalimschy <roberto@inf.puc-rio.br> 于2023年10月20日周五 02:16写道:
> 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
I would like to see the third subtype of lua string : external string
. The content of the string is a C pointer rather than bytes array.
So that we can construct the long strings in O(1), it's useful when we
want to use lua string library to manage the memory in C side.
Or if we have many lua vm in one process, it can reduce the cost of
message passing.
--
http://blog.codingnow.com