|
||
|
GP Mailing List
ATXGPSIG List
|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [gameprogrammer] Re: Scripting engines: Upvalues and function refs
Bob Pendleton wrote: Sorry for cutting the rest of the thread but I will talk about the GC >On Tue, 2004-04-13 at 04:52, David Olofson wrote: > > >>On Monday 12 April 2004 21.59, Bob Pendleton wrote: >>[...refcounting and/or GC...] >> >> Maybe this will give you some ideas for you GC problem : I have been working on a GC and related stuff for my master degree. It was about checkpointing Java programs. The JVM was dedicated to mobile devices running multimedia applications. So, we are in the soft real time situation. To ensure a regular execution (for the RT aspect) the choise to execute the GC explicitly has been done. One asumption is done : the program has some sort of main loop. The idea is to call the GC at the beginning of each iteration of the main loop. Of course, to reduce the overhead it is possible to call the GC every ten or hundred iteration. The drawback is that the developper has to call the GC explicitly in his app. The GC is a "mark and sweep" one. It tracks live objects by following references between objects. References are easy to track in Java since they are explictly defined by the langage as a type. In this way an object's field can be intergers, floats, references. The GC just examines the objects' fields and follows the references. Every time an object is created by the JVM, its reference is added to the "live object" list in the GC. When the GC do its references tracing it move the identified object from the "live objects" list to the "dest list". Finally, the objects remaining in the first list are "dead" objects and can be deleted. Maybe you could have a similar notion of reference in your language. Having a type for "pointer between object" is a convenient way to track link between objects. Julien
|
|