//#OPTIONS: CPP // weak reference support var h$weakPointerList = []; #ifdef GHCJS_TRACE_WEAK function h$traceWeak() { h$log.apply(h$log, arguments) } #define TRACE_WEAK(args...) h$traceWeak(args) #else #define TRACE_WEAK(args...) #endif // called by the GC after marking the heap function h$finalizeWeaks(toFinalize) { var mark = h$gcMark; var i, w; TRACE_WEAK("to finalize: " + toFinalize.length) // start a finalizer thread if any finalizers need to be run if(toFinalize.length > 0) { var t = new h$Thread(); for(i=0;i