[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Thinking about Lua memory management
- From: "Russell Y. Webb" <rw20@...>
- Date: Wed, 19 Sep 2001 01:23:13 -0700
> Both of these ideas require adding some code to the Lua interpreter everywhere
> a pointer to a heap object is written to.
You can do incremental collection by only adding code everytime an object is
allocated as long as it's marked as "in use". Then you incrementally scan
through everything marking things "in use" that you can reach, then
incrementally free everything else, and then incrementally unmark everything
and start over.
I even have a untested allocator of this sort somewhere that has hooks
traversing through whatever you allocate (I'll look for it). The collector
just has different incremental phases and new allocations are not ever
cleaned up until a full cycle passes which you can of course force to happen
whenever you want.
Russ