lua-users home
lua-l archive

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


> But that is true of *any* weak reference...

That is right. So its correctness depends on how you specify the
behavior of weak references. Lua weak references behave as it is
intended. That may not be the best or most useful behavior, but it
is not a bug.

My main worry is the use of the term "memory leak". It is very easy
for someone browsing the list to come up with "I read somewhere that
Lua has memory leaks". There may be several interesting theoretical
definitions for this term, but for the general public it means mainly
something like "memory lost forever". This is what garbage collectors
try to avoid, and what Lua collector does (without known bugs). Things
like contingency links, shrink tables, elimination of dead variables and
other optimizations are all desirable, but their absence do not create
memory leaks.

-- Roberto