aboutsummaryrefslogtreecommitdiff
path: root/manual
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2025-07-15 14:40:27 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2025-07-15 14:40:27 -0300
commit60b6599e8322dd93e3b33c9496ff035a1c45552f (patch)
treeeb0d9ffd85b1062aea36fa5b82e714931e718082 /manual
parentc612685d4b9ecdf0525b4d4410efa9f70d4b4518 (diff)
downloadlua-60b6599e8322dd93e3b33c9496ff035a1c45552f.tar.gz
lua-60b6599e8322dd93e3b33c9496ff035a1c45552f.tar.bz2
lua-60b6599e8322dd93e3b33c9496ff035a1c45552f.zip
Short strings can be external, too
That complicates a little object equality (and therefore table access for long strings), but the old behavior was somewhat weird. (Short strings, a concept otherwise absent from the manual, could not be external.)
Diffstat (limited to 'manual')
-rw-r--r--manual/manual.of12
1 files changed, 3 insertions, 9 deletions
diff --git a/manual/manual.of b/manual/manual.of
index 8f90f942..b2765774 100644
--- a/manual/manual.of
+++ b/manual/manual.of
@@ -2419,8 +2419,8 @@ for instance @T{foo(e1, e2, e3)} @see{functioncall}.}
2419@item{A multiple assignment, 2419@item{A multiple assignment,
2420for instance @T{a , b, c = e1, e2, e3} @see{assignment}.} 2420for instance @T{a , b, c = e1, e2, e3} @see{assignment}.}
2421 2421
2422@item{A local declaration, 2422@item{A local or global declaration,
2423for instance @T{local a , b, c = e1, e2, e3} @see{localvar}.} 2423which is a special case of multiple assignment.}
2424 2424
2425@item{The initial values in a generic @rw{for} loop, 2425@item{The initial values in a generic @rw{for} loop,
2426for instance @T{for k in e1, e2, e3 do ... end} @see{for}.} 2426for instance @T{for k in e1, e2, e3 do ... end} @see{for}.}
@@ -2431,8 +2431,7 @@ the list of values from the list of expressions
2431must be @emph{adjusted} to a specific length: 2431must be @emph{adjusted} to a specific length:
2432the number of parameters in a call to a non-variadic function 2432the number of parameters in a call to a non-variadic function
2433@see{func-def}, 2433@see{func-def},
2434the number of variables in a multiple assignment or 2434the number of variables in a multiple assignment or a declaration,
2435a local declaration,
2436and exactly four values for a generic @rw{for} loop. 2435and exactly four values for a generic @rw{for} loop.
2437The @def{adjustment} follows these rules: 2436The @def{adjustment} follows these rules:
2438If there are more values than needed, 2437If there are more values than needed,
@@ -4075,11 +4074,6 @@ the string @id{s} as the block,
4075the length plus one (to account for the ending zero) as the old size, 4074the length plus one (to account for the ending zero) as the old size,
4076and 0 as the new size. 4075and 0 as the new size.
4077 4076
4078Lua always @x{internalizes} strings with lengths up to 40 characters.
4079So, for strings in that range,
4080this function will immediately internalize the string
4081and call @id{falloc} to free the buffer.
4082
4083Even when using an external buffer, 4077Even when using an external buffer,
4084Lua still has to allocate a header for the string. 4078Lua still has to allocate a header for the string.
4085In case of a memory-allocation error, 4079In case of a memory-allocation error,