[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Lua gc in games
- From: "Nick Trout" <nick@...>
- Date: Mon, 6 Aug 2001 17:22:01 +0100
From: "Jonathan Branam" <sspeare@sspeare.com>
| introduce the concept of
| "const data" to the Lua GC. All of this (somehow specially marked)
| const data would be placed in a separate set of structures in
| Lua. When GC fired, it would simply not check this set at all.
| Also, if a non-const piece of data were to reference this set,
| the GC would not need to continue collecting in the const data.
Sounds interesting. I think you'd have a const ref rather than const data, ie.
to always retain a reference to some data. If the reference to the data changed
and it was the only reference you couldnt retrieve it (ie. a leak).
eg.
const t = { a=1,b=2,c=3 }
function const x ()
local a = 5
local const b = 7
end
Neither x or b could be reassigned and would not need to be marked and sweeped.
b would have to be static, ie, you would not create 7 every time. consts would
only be collected when the state closed. If const was used extensively, garbage
collection would be a tad quicker methinks.
N