[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: rapid lifetime based collection of transient user data objects?
- From: Joshua Jensen <josh.jjensen@...>
- Date: Sat, 29 Oct 2011 01:03:14 -0600
----- Original Message -----
From: Ross Bencina
Date: 10/28/2011 8:56 PM
Given that these user data are number-like and cannot hold references
to other objects, I think one approach might be to use reference
counting. Also at least within expressions, and for objects created
and used only in a single scope, it might be relatively easy to
determine their lifetime using static analysis.
I can't recall if I ever did a standalone LuaRC 5.1, but the reference
counting is definitely in the LuaPlus  source code. Look for
LUA_REFCOUNT and copy the changes into your copy of Lua. It works in
almost all instances, and it is very effective at keeping memory under
control. I also like that it adds deterministic finalization to Lua.
It looks like LuaRC/LuaPlus [3, 4] reference counting system might be
one possible approach. Does that seem like a good fit for what I've
described above? Are there other options or approaches I should know
about? How have other people solved this problem? Are these issues
being considered at all for main-line Lua development or are they
considered out of scope?
 Subject: Re: Reference counting patch for Lua 5.1?