lua-users home
lua-l archive

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



On Sunday, November 3, 2002, at 07:55  AM, Thatcher Ulrich wrote:

It is not "an unsorted bag of different-sized chunks."
The treadmills are segregated into size classes.

Sorry, my mistake.  I suppose you can always keep a count of free
chunks and sweep if it grows too big, to avoid consuming too much of
the C heap.


In one version I had one treadmill for finalizers, which were small objects that caused their referents to be finalized when they were collected*. I would sweep that free list incrementally. I also would incrementally sweep the large size classes. But the small size classes are not swept.

*An object that wants to be finalized creates one of these finalizer objects and points to it, the finalizer object points back to the object to be finalized, so you have a small loop. When the finalizer object gets collected, then the other object must be garbage too, so it calls that object's finalize method. This trick allowed me to only have to sweep a short list of objects that need to be finalized, instead of all newly freed objects each time.

--
--- james mccartney   james@audiosynth.com   <http://www.audiosynth.com>
SuperCollider - a real time synthesis programming language for the PowerMac.


--
--- james mccartney   james@audiosynth.com   <http://www.audiosynth.com>
SuperCollider - a real time synthesis programming language for the PowerMac.
<ftp://www.audiosynth.com/pub/updates/SC2.2.16.sea.hqx>