From 4593fb5e29adc09cd53beaba8777f5656434c08d Mon Sep 17 00:00:00 2001 From: Mike Pall Date: Mon, 25 Nov 2013 15:18:31 +0100 Subject: Add table.clear(). --- doc/extensions.html | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'doc') 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 too expensive.

+

table.clear(tab) clears a table

+

+An extra library function table.clear() can be made available +via require("table.clear"). This clears all keys and values +from a table, but preserves the allocated array/hash sizes. This is +useful when a table, which is linked from multiple places, needs to be +cleared and/or when recycling a table for use by the same context. This +avoids managing backlinks, saves an allocation and the overhead of +incremental array/hash part growth. +

+

+Please note this function is meant for very specific situations. In most +cases it's better to replace the (usually single) link with a new table +and let the GC do its work. +

+

Enhanced PRNG for math.random()

LuaJIT uses a Tausworthe PRNG with period 2^223 to implement -- cgit v1.2.3-55-g6feb