On Thu, Mar 18, 2010 at 11:36 AM, Enlightenment SVN
<no-re...@enlightenment.org> wrote:
> Log:
>        * elixir: Force more often call to GC to keep memory profile low.
>
> Author:       cedric
> Date:         2010-03-18 07:36:35 -0700 (Thu, 18 Mar 2010)
> New Revision: 47318
>
> Modified:
>  trunk/BINDINGS/javascript/elixir/src/lib/elixir_run.c 
> trunk/BINDINGS/javascript/elixir/src/modules/bindings/ecore/ecore_module.c
>
> Modified: trunk/BINDINGS/javascript/elixir/src/lib/elixir_run.c
> ===================================================================
> --- trunk/BINDINGS/javascript/elixir/src/lib/elixir_run.c       2010-03-18 
> 12:20:40 UTC (rev 47317)
> +++ trunk/BINDINGS/javascript/elixir/src/lib/elixir_run.c       2010-03-18 
> 14:36:35 UTC (rev 47318)
> @@ -497,6 +497,8 @@
>        JS_ClearPendingException(cx);
>      }
>
> +   JS_MaybeGC(cx);
> +
>    elixir_object_unregister(cx, &obj);
>
>    for (i = 0; i < argc; ++i)
>
> Modified: 
> trunk/BINDINGS/javascript/elixir/src/modules/bindings/ecore/ecore_module.c
> ===================================================================
> --- 
> trunk/BINDINGS/javascript/elixir/src/modules/bindings/ecore/ecore_module.c  
> 2010-03-18 12:20:40 UTC (rev 47317)
> +++ 
> trunk/BINDINGS/javascript/elixir/src/modules/bindings/ecore/ecore_module.c  
> 2010-03-18 14:36:35 UTC (rev 47318)
> @@ -146,7 +146,30 @@
>    return JS_TRUE;
>  }
>
> -FAST_CALL_PARAMS(ecore_init, elixir_int_params_void);
> +static int
> +_elixir_ecore_maybe_gc(void *data)
> +{
> +   JSContext *cx = data;
> +
> +   JS_MaybeGC(cx);
> +}

missing return!


> +
> +static JSBool
> +elixir_ecore_init(JSContext *cx, uintN argc, jsval *vp)
> +{
> +   int r;
> +
> +   if (!elixir_params_check(cx, void_params, NULL, argc, JS_ARGV(cx, vp)))
> +     return JS_FALSE;
> +
> +   r = ecore_init();
> +
> +   ecore_idle_enterer_add(_elixir_ecore_maybe_gc, cx);
> +
> +   JS_SET_RVAL(cx, vp, INT_TO_JSVAL(r));
> +   return JS_TRUE;
> +}

I don't know your use case or the cost of your JS_MaybeGC(), but I
fear this will impact systems with good amount of objects if this
forces circular dependency calculations and all.

I'd rather do like ecore-evas does for evas_idle_flush and add a timer
to expire after some time and avoid lots of calls... actually we could
add such as part of ecore_job? Like another class, so ecore-evas and
your code could share the same stuff?

BR,


-- 
Gustavo Sverzut Barbieri
http://profusion.mobi embedded systems
--------------------------------------
MSN: barbi...@gmail.com
Skype: gsbarbieri
Mobile: +55 (19) 9225-2202

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to