aboutsummaryrefslogtreecommitdiff
path: root/manual
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2024-01-18 15:16:26 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2024-01-18 15:16:26 -0300
commit3e9dbe143d3338f5f13a5e421ea593adff482da0 (patch)
treece070c600970d216f3a68c78ae9e55d8048ec4ff /manual
parent4a8e48086433ad12f2991c07f3064278714fd0f1 (diff)
downloadlua-3e9dbe143d3338f5f13a5e421ea593adff482da0.tar.gz
lua-3e9dbe143d3338f5f13a5e421ea593adff482da0.tar.bz2
lua-3e9dbe143d3338f5f13a5e421ea593adff482da0.zip
New function 'table.create'
Creates a table preallocating memory. (It just exports to Lua the API function 'lua_createtable'.)
Diffstat (limited to 'manual')
-rw-r--r--manual/manual.of17
1 files changed, 15 insertions, 2 deletions
diff --git a/manual/manual.of b/manual/manual.of
index 48f396d9..42269ff4 100644
--- a/manual/manual.of
+++ b/manual/manual.of
@@ -3234,11 +3234,11 @@ Values at other positions are not affected.
3234 3234
3235} 3235}
3236 3236
3237@APIEntry{void lua_createtable (lua_State *L, int narr, int nrec);| 3237@APIEntry{void lua_createtable (lua_State *L, int nseq, int nrec);|
3238@apii{0,1,m} 3238@apii{0,1,m}
3239 3239
3240Creates a new empty table and pushes it onto the stack. 3240Creates a new empty table and pushes it onto the stack.
3241Parameter @id{narr} is a hint for how many elements the table 3241Parameter @id{nseq} is a hint for how many elements the table
3242will have as a sequence; 3242will have as a sequence;
3243parameter @id{nrec} is a hint for how many other elements 3243parameter @id{nrec} is a hint for how many other elements
3244the table will have. 3244the table will have.
@@ -7969,6 +7969,19 @@ If @id{i} is greater than @id{j}, returns the empty string.
7969 7969
7970} 7970}
7971 7971
7972@LibEntry{table.create (nseq [, nrec])|
7973
7974Creates a new empty table, preallocating memory.
7975This preallocation may help performance and save memory
7976when you know in advance how many elements the table will have.
7977
7978Parameter @id{nseq} is a hint for how many elements the table
7979will have as a sequence.
7980Optional parameter @id{nrec} is a hint for how many other elements
7981the table will have; its default is zero.
7982
7983}
7984
7972@LibEntry{table.insert (list, [pos,] value)| 7985@LibEntry{table.insert (list, [pos,] value)|
7973 7986
7974Inserts element @id{value} at position @id{pos} in @id{list}, 7987Inserts element @id{value} at position @id{pos} in @id{list},