lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Mon, Nov 25, 2013 at 9:58 AM, Mike Pall <mikelu-1311@mike.de> 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.

-- 
Javier