aboutsummaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorMike Pall <mike>2013-11-25 15:18:31 +0100
committerMike Pall <mike>2013-11-25 15:19:17 +0100
commit4593fb5e29adc09cd53beaba8777f5656434c08d (patch)
tree104b63db5384ad540451645294879e2cdc91ad28 /doc
parentc378f7dbb882068d1ae06edc8e7049fb1907db2d (diff)
downloadluajit-4593fb5e29adc09cd53beaba8777f5656434c08d.tar.gz
luajit-4593fb5e29adc09cd53beaba8777f5656434c08d.tar.bz2
luajit-4593fb5e29adc09cd53beaba8777f5656434c08d.zip
Add table.clear().
Diffstat (limited to 'doc')
-rw-r--r--doc/extensions.html16
1 files changed, 16 insertions, 0 deletions
diff --git a/doc/extensions.html b/doc/extensions.html
index 48f4220c..3443f201 100644
--- a/doc/extensions.html
+++ b/doc/extensions.html
@@ -217,6 +217,22 @@ tables if the final table size is known and automatic table resizing is
217too expensive. 217too expensive.
218</p> 218</p>
219 219
220<h3 id="table_clear"><tt>table.clear(tab)</tt> clears a table</h3>
221<p>
222An extra library function <tt>table.clear()</tt> can be made available
223via <tt>require("table.clear")</tt>. This clears all keys and values
224from a table, but preserves the allocated array/hash sizes. This is
225useful when a table, which is linked from multiple places, needs to be
226cleared and/or when recycling a table for use by the same context. This
227avoids managing backlinks, saves an allocation and the overhead of
228incremental array/hash part growth.
229</p>
230<p>
231Please note this function is meant for very specific situations. In most
232cases it's better to replace the (usually single) link with a new table
233and let the GC do its work.
234</p>
235
220<h3 id="math_random">Enhanced PRNG for <tt>math.random()</tt></h3> 236<h3 id="math_random">Enhanced PRNG for <tt>math.random()</tt></h3>
221<p> 237<p>
222LuaJIT uses a Tausworthe PRNG with period 2^223 to implement 238LuaJIT uses a Tausworthe PRNG with period 2^223 to implement