edje: doing less is actually better.
authorcedric <cedric@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Wed, 2 May 2012 06:55:15 +0000 (06:55 +0000)
committercedric <cedric@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Wed, 2 May 2012 06:55:15 +0000 (06:55 +0000)
git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/edje@70608 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

ChangeLog
NEWS
src/lib/edje_calc.c

index a052da6..2d9cb5f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
 2012-04-30  Jérôme Pinot
 
        * Add missing files in the tarballs.
+
+2012-05-02  Cedric Bail
+
+       * Doing less allocation and reuse Evas_Map does help.
diff --git a/NEWS b/NEWS
index 6fdcb62..88c69a6 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -3,6 +3,9 @@ Edje 1.3.0
 Changes since Edje 1.2.0:
 -------------------------
 
+Improvements:
+    * Allocate once and reuse Evas_Map.
+
 Fixes:
     * Add missing files in the tarballs.
 
index 6aa6336..e2642df 100644 (file)
@@ -2840,11 +2840,11 @@ _edje_part_recalc(Edje *ed, Edje_Real_Part *ep, int flags, Edje_Calc_Params *sta
         else mo = ep->object;
         if (chosen_desc->map.on)
           {
-             Evas_Map *map;
+             static Evas_Map *map = NULL;
 
              ed->have_mapped_part = 1;
              // create map and populate with part geometry
-             map = evas_map_new(4);
+            if (!map) map = evas_map_new(4);
              evas_map_util_points_populate_from_object(map, ep->object);
              if (ep->part->type == EDJE_PART_TYPE_IMAGE)
                {
@@ -2898,7 +2898,6 @@ _edje_part_recalc(Edje *ed, Edje_Real_Part *ep, int flags, Edje_Calc_Params *sta
 
              evas_object_map_set(mo, map);
              evas_object_map_enable_set(mo, 1);
-             evas_map_free(map);
           }
         else
           {