michael@0: var objs; michael@0: michael@0: function init() michael@0: { michael@0: objs = new Object(); michael@0: var x = new Object(); michael@0: objs.root1 = x; michael@0: objs.root2 = new Object(); michael@0: x.ptr = new Object(); michael@0: x = null; michael@0: michael@0: /* michael@0: * Clears out the arena lists. Otherwise all the objects above michael@0: * would be considered to be created during the incremental GC. michael@0: */ michael@0: gc(); michael@0: } michael@0: michael@0: /* michael@0: * Use eval here so that the interpreter frames end up higher on the michael@0: * stack, which avoids them being seen later on by the conservative michael@0: * scanner. michael@0: */ michael@0: eval("init()"); michael@0: michael@0: gcslice(0); michael@0: selectforgc(objs.root2); michael@0: gcslice(1); michael@0: objs.root2.ptr = objs.root1.ptr; michael@0: objs.root1.ptr = null; michael@0: gcslice();