[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: table.new in 5.3?
- From: Mike Pall <mikelu-1311@...>
- Date: Sun, 24 Nov 2013 12:53:16 +0100
Roberto Ierusalimschy wrote:
> Moreover, table.clear should be able to release the memory used by the table
> immediately, independent of the GC.
That's not the intended use case. This is about recycling a table
for the same or a similar context. Keeping the current hash/array
sizes is considered beneficial.
That's where the name comes from: table.clear() only 'clears' the
keys/values from the table. It doesn't change the sizes, it doesn't
shrink or reset the table (which would be much less useful in
practice).
--Mike