[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: table.new in 5.3?
- From: Javier Guerra Giraldez <javier@...>
- Date: Mon, 25 Nov 2013 13:00:54 -0500
On Mon, Nov 25, 2013 at 9:58 AM, Mike Pall <firstname.lastname@example.org> wrote:
>> what happens if there's
>> a big table, i clear() it, and then add a single key/value. would it
>> stay big forever? until the next garbage collection? or immediately,
>> as the set function detects it's way oversized?
> It would stay big. But that's neither the common case nor the
> specific use case: recycling from the same context, with similar
> usage patterns.
yep, i get that intended use. i asked precisely because i wanted to
understand how it could fall apart when misused.
>> if the later, then how am i supposed to 'recycle' big structures?
> That's a very different use case. It's not _recycling_ that you're
> after, you want it to _release_ its memory.
since the answer to the first question is "stays big", then this
question doesn't apply. if it was resized more aggressively then it
would be a valid concern.