diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2025-07-15 14:40:27 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2025-07-15 14:40:27 -0300 |
commit | 60b6599e8322dd93e3b33c9496ff035a1c45552f (patch) | |
tree | eb0d9ffd85b1062aea36fa5b82e714931e718082 /manual | |
parent | c612685d4b9ecdf0525b4d4410efa9f70d4b4518 (diff) | |
download | lua-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.of | 12 |
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, |
2420 | for instance @T{a , b, c = e1, e2, e3} @see{assignment}.} | 2420 | for instance @T{a , b, c = e1, e2, e3} @see{assignment}.} |
2421 | 2421 | ||
2422 | @item{A local declaration, | 2422 | @item{A local or global declaration, |
2423 | for instance @T{local a , b, c = e1, e2, e3} @see{localvar}.} | 2423 | which 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, |
2426 | for instance @T{for k in e1, e2, e3 do ... end} @see{for}.} | 2426 | for 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 | |||
2431 | must be @emph{adjusted} to a specific length: | 2431 | must be @emph{adjusted} to a specific length: |
2432 | the number of parameters in a call to a non-variadic function | 2432 | the number of parameters in a call to a non-variadic function |
2433 | @see{func-def}, | 2433 | @see{func-def}, |
2434 | the number of variables in a multiple assignment or | 2434 | the number of variables in a multiple assignment or a declaration, |
2435 | a local declaration, | ||
2436 | and exactly four values for a generic @rw{for} loop. | 2435 | and exactly four values for a generic @rw{for} loop. |
2437 | The @def{adjustment} follows these rules: | 2436 | The @def{adjustment} follows these rules: |
2438 | If there are more values than needed, | 2437 | If there are more values than needed, |
@@ -4075,11 +4074,6 @@ the string @id{s} as the block, | |||
4075 | the length plus one (to account for the ending zero) as the old size, | 4074 | the length plus one (to account for the ending zero) as the old size, |
4076 | and 0 as the new size. | 4075 | and 0 as the new size. |
4077 | 4076 | ||
4078 | Lua always @x{internalizes} strings with lengths up to 40 characters. | ||
4079 | So, for strings in that range, | ||
4080 | this function will immediately internalize the string | ||
4081 | and call @id{falloc} to free the buffer. | ||
4082 | |||
4083 | Even when using an external buffer, | 4077 | Even when using an external buffer, |
4084 | Lua still has to allocate a header for the string. | 4078 | Lua still has to allocate a header for the string. |
4085 | In case of a memory-allocation error, | 4079 | In case of a memory-allocation error, |