summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2016-07-04 14:59:59 +0900
committerVitalii Vorobiov <vi.vorobiov@samsung.com>2016-07-21 16:40:49 +0300
commit5e240c0982f8ae089a9b2e6e6edf698f1aeedf3d (patch)
treecac54724d4c4a76628f33efbdeb7175791600a30 /src
parent57dc173f52ba9b74af9eb400b4ca10bf7c9ece2f (diff)
downloadefl-5e240c0982f8ae089a9b2e6e6edf698f1aeedf3d.tar.gz
edje - reduce memory footprint by rearranging structs and types
this should cut some memory used by edje by using smaller types like shorts instead of ints where we just dont need a full int range and short will do, and re-ordering in memory data soit packs better when accoutning for alignment
Diffstat (limited to 'src')
-rw-r--r--src/lib/edje/edje_edit.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/lib/edje/edje_edit.c b/src/lib/edje/edje_edit.c
index 1d6fabe1b3..924ce20e3c 100644
--- a/src/lib/edje/edje_edit.c
+++ b/src/lib/edje/edje_edit.c
@@ -782,7 +782,7 @@ _edje_fix_parts_id(Edje *ed)
*/
unsigned int i;
int correct_id;
- unsigned int count;
+ unsigned short count;
//printf("FIXING PARTS ID \n");
@@ -805,7 +805,7 @@ _edje_fix_parts_id(Edje *ed)
}
/* If we have removed some parts realloc table_parts */
- count = ed->collection->parts_count;
+ count = (unsigned short)ed->collection->parts_count;
if (count != ed->table_parts_size)
{
ed->table_parts = realloc(ed->table_parts, sizeof(Edje_Real_Part *) * count);
@@ -2988,7 +2988,7 @@ EAPI Eina_List *
edje_edit_parts_list_get(Evas_Object *obj)
{
Eina_List *parts = NULL;
- unsigned int i;
+ unsigned short i;
GET_ED_OR_RETURN(NULL);
@@ -3055,6 +3055,7 @@ _edje_edit_real_part_add(Evas_Object *obj, const char *name, Edje_Part_Type type
GET_ED_OR_RETURN(EINA_FALSE);
+ if (ed->table_parts_size == 0xffff) return EINA_FALSE;
//printf("ADD PART: %s [type: %d]\n", name, type);
/* Check if part already exists */
@@ -3253,7 +3254,7 @@ edje_edit_part_del(Evas_Object *obj, const char *part)
Edje_Part *ep;
unsigned int k;
unsigned int id;
- unsigned int i;
+ unsigned short i;
GET_EED_OR_RETURN(EINA_FALSE);
GET_RP_OR_RETURN(EINA_FALSE);
@@ -3464,7 +3465,7 @@ edje_edit_part_above_get(Evas_Object *obj, const char *part)
GET_RP_OR_RETURN(0);
- if ((unsigned int)rp->part->id >= ed->table_parts_size - 1) return 0;
+ if ((unsigned short)rp->part->id >= ed->table_parts_size - 1) return 0;
next = ed->table_parts[(rp->part->id + 1) % ed->table_parts_size];
@@ -3555,7 +3556,7 @@ edje_edit_part_restack_above(Evas_Object *obj, const char *part)
//printf("RESTACK PART: %s ABOVE\n", part);
- if ((unsigned int)rp->part->id >= ed->table_parts_size - 1) return EINA_FALSE;
+ if ((unsigned short)rp->part->id >= ed->table_parts_size - 1) return EINA_FALSE;
group = ed->collection;
@@ -7948,7 +7949,7 @@ edje_edit_state_text_set(Evas_Object *obj, const char *part, const char *state,
{
Edje_Part_Description_Text *txt;
Edje_Real_Part *real;
- unsigned int i;
+ unsigned short i;
if (!text)
return EINA_FALSE;
@@ -12063,7 +12064,8 @@ edje_edit_source_generate(Evas_Object *obj)
Edje_Part_Description_Common *part_desc;
Edje_Part_Description_Image *part_desc_image;
Edje_Part_Description_Text *part_desc_text;
- unsigned int i, j;
+ unsigned short i;
+ unsigned int j;
const char *entry;
const char *str;
Eina_Strbuf *buf = NULL;