Enlightenment CVS committal

Author  : rbdpngn
Project : e17
Module  : libs/ewl

Dir     : e17/libs/ewl/src/lib


Modified Files:
        ewl_widget.c 


Log Message:
Less strict string dereferences to improve caching behavior.

===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/lib/ewl_widget.c,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -3 -r1.42 -r1.43
--- ewl_widget.c        25 Nov 2005 06:13:27 -0000      1.42
+++ ewl_widget.c        27 Nov 2005 08:02:06 -0000      1.43
@@ -12,6 +12,8 @@
 static void ewl_widget_appearance_part_text_apply(Ewl_Widget * w, char *part,
                                                char *text);
 
+/* static int edjes = 0; */
+
 /**
  * @brief Allocate a new widget.
  * @return Returns a newly allocated widget on success, NULL on failure.
@@ -539,12 +541,10 @@
        if (w->appearance && !strcmp(appearance, w->appearance))
                DLEAVE_FUNCTION(DLEVEL_STABLE);
 
-       if (w->appearance)
-               ecore_string_release(w->appearance);
-
        /*
         * The base appearance is used for determining the theme key of the
-        * widget.
+        * widget. Intentionally lose a reference to the ecore string to keep a
+        * reference cached for later re-use.
         */
        w->appearance = ecore_string_instance(appearance);
        if (!w->appearance)
@@ -644,16 +644,16 @@
 void
 ewl_widget_state_set(Ewl_Widget *w, char *state)
 {
-       char *old;
-
        DENTER_FUNCTION(DLEVEL_STABLE);
        DCHECK_PARAM_PTR("w", w);
        DCHECK_PARAM_PTR("state", state);
        DCHECK_TYPE("w", w, "widget");
 
-       old = w->bit_state;
+       /*
+        * Intentionally lose a reference to the ecore string to keep a
+        * reference cached for later re-use.
+        */
        w->bit_state = ecore_string_instance(state);
-       if (old) ecore_string_release(old);
 
        if (w->theme_object)
                edje_object_signal_emit(w->theme_object, state, "EWL");
@@ -1240,8 +1240,10 @@
        tmp = malloc(sizeof(char) * len);
        sprintf(tmp, "%s:%s:", tmp2, inherit);
 
-       if (widget->inheritance)
-               ecore_string_release(widget->inheritance);
+       /*
+        * Intentionally lose a reference to the ecore string to keep a
+        * reference cached for later re-use.
+        */
        widget->inheritance = ecore_string_instance(tmp);
 
        FREE(tmp);




-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to