From: Gabriel Ivăncescu gabrielopcode@gmail.com
Better heuristics can be used in the future.
Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com --- dlls/jscript/dispex.c | 5 +++++ dlls/jscript/jscript.h | 1 + 2 files changed, 6 insertions(+)
diff --git a/dlls/jscript/dispex.c b/dlls/jscript/dispex.c index f41008afa2d..a50787a73fe 100644 --- a/dlls/jscript/dispex.c +++ b/dlls/jscript/dispex.c @@ -878,6 +878,7 @@ HRESULT gc_run(script_ctx_t *ctx) jsdisp_release(obj); }
+ ctx->gc_last_tick = GetTickCount(); return S_OK;
unwind_pop: @@ -2061,6 +2062,10 @@ HRESULT init_dispex(jsdisp_t *dispex, script_ctx_t *ctx, const builtin_info_t *b { unsigned i;
+ /* FIXME: Use better heuristics to decide when to run the GC */ + if(GetTickCount() - ctx->gc_last_tick > 30000) + gc_run(ctx); + TRACE("%p (%p)\n", dispex, prototype);
dispex->IDispatchEx_iface.lpVtbl = &DispatchExVtbl; diff --git a/dlls/jscript/jscript.h b/dlls/jscript/jscript.h index acdc5652a80..37fb145dfca 100644 --- a/dlls/jscript/jscript.h +++ b/dlls/jscript/jscript.h @@ -392,6 +392,7 @@ struct _script_ctx_t {
jsval_t *stack; unsigned stack_top; + DWORD gc_last_tick; jsval_t acc;
jsstr_t *last_match;