forked from enlightenment/efl
edje: recycle and use less memory during load time.
SVN revision: 76445
This commit is contained in:
parent
b757565407
commit
979f7879ba
|
@ -611,3 +611,4 @@
|
||||||
* O(1) lookup used when searching Part_Lookup in edje_cc.
|
* O(1) lookup used when searching Part_Lookup in edje_cc.
|
||||||
* O(1) lookup when generating alias of group.
|
* O(1) lookup when generating alias of group.
|
||||||
* O(1) access time for parameters in edje_cc_handler.
|
* O(1) access time for parameters in edje_cc_handler.
|
||||||
|
* Recycle and use less memory during load time.
|
||||||
|
|
|
@ -14,6 +14,7 @@ Improvements:
|
||||||
* O(1) lookup used when searching Part_Lookup in edje_cc.
|
* O(1) lookup used when searching Part_Lookup in edje_cc.
|
||||||
* O(1) lookup when generating alias of group.
|
* O(1) lookup when generating alias of group.
|
||||||
* O(1) access time for parameters in edje_cc_handler.
|
* O(1) access time for parameters in edje_cc_handler.
|
||||||
|
* Recycle and use less memory during load time.
|
||||||
|
|
||||||
Fixes:
|
Fixes:
|
||||||
|
|
||||||
|
|
|
@ -348,7 +348,7 @@ _edje_object_file_set_internal(Evas_Object *obj, const char *file, const char *g
|
||||||
Eina_List *externals = NULL;
|
Eina_List *externals = NULL;
|
||||||
Eina_List *collect = NULL;
|
Eina_List *collect = NULL;
|
||||||
unsigned int n;
|
unsigned int n;
|
||||||
Eina_List *parts = NULL;
|
Eina_Array parts;
|
||||||
int group_path_started = 0;
|
int group_path_started = 0;
|
||||||
Evas_Object *nested_smart = NULL;
|
Evas_Object *nested_smart = NULL;
|
||||||
|
|
||||||
|
@ -406,7 +406,9 @@ _edje_object_file_set_internal(Evas_Object *obj, const char *file, const char *g
|
||||||
|
|
||||||
if (ed->collection)
|
if (ed->collection)
|
||||||
{
|
{
|
||||||
if (ed->collection->prop.orientation != EDJE_ORIENTATION_AUTO)
|
eina_array_step_set(&parts, sizeof (Eina_Array), 8);
|
||||||
|
|
||||||
|
if (ed->collection->prop.orientation != EDJE_ORIENTATION_AUTO)
|
||||||
ed->is_rtl = (ed->collection->prop.orientation ==
|
ed->is_rtl = (ed->collection->prop.orientation ==
|
||||||
EDJE_ORIENTATION_RTL);
|
EDJE_ORIENTATION_RTL);
|
||||||
|
|
||||||
|
@ -475,9 +477,7 @@ _edje_object_file_set_internal(Evas_Object *obj, const char *file, const char *g
|
||||||
{
|
{
|
||||||
/* FIXME: destroy all allocated ressource, need to have a common exit point */
|
/* FIXME: destroy all allocated ressource, need to have a common exit point */
|
||||||
ed->load_error = EDJE_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED;
|
ed->load_error = EDJE_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED;
|
||||||
evas_event_thaw(tev);
|
goto on_error;
|
||||||
evas_event_thaw_eval(tev);
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
memset(rp, 0, sizeof (Edje_Real_Part));
|
memset(rp, 0, sizeof (Edje_Real_Part));
|
||||||
|
@ -488,10 +488,7 @@ _edje_object_file_set_internal(Evas_Object *obj, const char *file, const char *g
|
||||||
if (!rp->drag)
|
if (!rp->drag)
|
||||||
{
|
{
|
||||||
ed->load_error = EDJE_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED;
|
ed->load_error = EDJE_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED;
|
||||||
eina_mempool_free(_edje_real_part_mp, rp);
|
goto on_error;
|
||||||
evas_event_thaw(tev);
|
|
||||||
evas_event_thaw_eval(tev);
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
rp->drag->step.x = FROM_INT(ep->dragable.step_x);
|
rp->drag->step.x = FROM_INT(ep->dragable.step_x);
|
||||||
|
@ -501,7 +498,7 @@ _edje_object_file_set_internal(Evas_Object *obj, const char *file, const char *g
|
||||||
rp->edje = ed;
|
rp->edje = ed;
|
||||||
_edje_ref(rp->edje);
|
_edje_ref(rp->edje);
|
||||||
rp->part = ep;
|
rp->part = ep;
|
||||||
parts = eina_list_append(parts, rp);
|
eina_array_push(&parts, rp);
|
||||||
rp->param1.description =
|
rp->param1.description =
|
||||||
_edje_part_description_find(ed, rp, "default", 0.0);
|
_edje_part_description_find(ed, rp, "default", 0.0);
|
||||||
rp->chosen_description = rp->param1.description;
|
rp->chosen_description = rp->param1.description;
|
||||||
|
@ -629,18 +626,15 @@ _edje_object_file_set_internal(Evas_Object *obj, const char *file, const char *g
|
||||||
}
|
}
|
||||||
if (n > 0)
|
if (n > 0)
|
||||||
{
|
{
|
||||||
Eina_List *l;
|
|
||||||
|
|
||||||
ed->table_parts = malloc(sizeof(Edje_Real_Part *) * n);
|
ed->table_parts = malloc(sizeof(Edje_Real_Part *) * n);
|
||||||
ed->table_parts_size = n;
|
ed->table_parts_size = n;
|
||||||
/* FIXME: check malloc return */
|
/* FIXME: check malloc return */
|
||||||
n = 0;
|
n = eina_array_count(&parts) - 1;
|
||||||
EINA_LIST_FOREACH(parts, l, rp)
|
while ((rp = eina_array_pop(&parts)))
|
||||||
{
|
{
|
||||||
ed->table_parts[n] = rp;
|
ed->table_parts[n] = rp;
|
||||||
n++;
|
n--;
|
||||||
}
|
}
|
||||||
eina_list_free(parts);
|
|
||||||
for (i = 0; i < ed->table_parts_size; i++)
|
for (i = 0; i < ed->table_parts_size; i++)
|
||||||
{
|
{
|
||||||
rp = ed->table_parts[i];
|
rp = ed->table_parts[i];
|
||||||
|
@ -849,23 +843,9 @@ _edje_object_file_set_internal(Evas_Object *obj, const char *file, const char *g
|
||||||
{
|
{
|
||||||
ERR("recursive loop group '%s' already included inside part '%s' of group '%s' from file '%s'",
|
ERR("recursive loop group '%s' already included inside part '%s' of group '%s' from file '%s'",
|
||||||
group_path_entry, rp->part->name, group, file);
|
group_path_entry, rp->part->name, group, file);
|
||||||
textblocks = eina_list_free(textblocks);
|
ed->load_error = EDJE_LOAD_ERROR_RECURSIVE_REFERENCE;
|
||||||
externals = eina_list_free(externals);
|
eina_stringshare_del(group_path_entry);
|
||||||
sources = eina_list_free(sources);
|
goto on_error;
|
||||||
_edje_thaw(ed);
|
|
||||||
_edje_unblock(ed);
|
|
||||||
_edje_unref(ed);
|
|
||||||
_edje_file_del(ed);
|
|
||||||
eina_stringshare_del(group_path_entry);
|
|
||||||
if (group_path_started)
|
|
||||||
{
|
|
||||||
eina_stringshare_del(eina_list_data_get(group_path));
|
|
||||||
eina_list_free(group_path);
|
|
||||||
}
|
|
||||||
ed->load_error = EDJE_LOAD_ERROR_RECURSIVE_REFERENCE;
|
|
||||||
evas_event_thaw(tev);
|
|
||||||
evas_event_thaw_eval(tev);
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -880,27 +860,10 @@ _edje_object_file_set_internal(Evas_Object *obj, const char *file, const char *g
|
||||||
{
|
{
|
||||||
ERR("impossible to set part '%s' of group '%s' from file '%s' to '%s'",
|
ERR("impossible to set part '%s' of group '%s' from file '%s' to '%s'",
|
||||||
rp->part->name, group_path_entry, file, source);
|
rp->part->name, group_path_entry, file, source);
|
||||||
textblocks = eina_list_free(textblocks);
|
|
||||||
externals = eina_list_free(externals);
|
|
||||||
sources = eina_list_free(sources);
|
|
||||||
_edje_thaw(ed);
|
|
||||||
_edje_unblock(ed);
|
|
||||||
_edje_unref(ed);
|
|
||||||
_edje_file_del(ed);
|
|
||||||
|
|
||||||
if (group_path_started)
|
|
||||||
{
|
|
||||||
while (group_path)
|
|
||||||
{
|
|
||||||
eina_stringshare_del(eina_list_data_get(group_path));
|
|
||||||
group_path = eina_list_remove_list(group_path, group_path);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
ed->load_error = edje_object_load_error_get(child_obj);
|
ed->load_error = edje_object_load_error_get(child_obj);
|
||||||
evas_object_del(child_obj);
|
evas_object_del(child_obj);
|
||||||
evas_event_thaw(tev);
|
eina_stringshare_del(group_path_entry);
|
||||||
evas_event_thaw_eval(tev);
|
goto on_error;
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
group_path = eina_list_remove(group_path, group_path_entry);
|
group_path = eina_list_remove(group_path, group_path_entry);
|
||||||
|
@ -1065,6 +1028,7 @@ _edje_object_file_set_internal(Evas_Object *obj, const char *file, const char *g
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
_edje_entry_init(ed);
|
_edje_entry_init(ed);
|
||||||
|
eina_array_flush(&parts);
|
||||||
evas_event_thaw(tev);
|
evas_event_thaw(tev);
|
||||||
evas_event_thaw_eval(tev);
|
evas_event_thaw_eval(tev);
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -1080,6 +1044,26 @@ _edje_object_file_set_internal(Evas_Object *obj, const char *file, const char *g
|
||||||
evas_event_thaw(tev);
|
evas_event_thaw(tev);
|
||||||
evas_event_thaw_eval(tev);
|
evas_event_thaw_eval(tev);
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
|
on_error:
|
||||||
|
textblocks = eina_list_free(textblocks);
|
||||||
|
externals = eina_list_free(externals);
|
||||||
|
sources = eina_list_free(sources);
|
||||||
|
eina_array_flush(&parts);
|
||||||
|
_edje_thaw(ed);
|
||||||
|
_edje_unblock(ed);
|
||||||
|
_edje_unref(ed);
|
||||||
|
_edje_file_del(ed);
|
||||||
|
if (group_path_started)
|
||||||
|
{
|
||||||
|
const char *path;
|
||||||
|
|
||||||
|
EINA_LIST_FREE(group_path, path)
|
||||||
|
eina_stringshare_del(path);
|
||||||
|
}
|
||||||
|
evas_event_thaw(tev);
|
||||||
|
evas_event_thaw_eval(tev);
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -1663,7 +1647,7 @@ _edje_collection_free_part_description_free(int type,
|
||||||
|
|
||||||
#ifdef EDJE_PROGRAM_CACHE
|
#ifdef EDJE_PROGRAM_CACHE
|
||||||
static Eina_Bool
|
static Eina_Bool
|
||||||
_edje_collection_free_prog_cache_matches_free_cb(const Eina_Hash *hash, const void *key, void *data, void *fdata)
|
_edje_collection_free_prog_cache_matches_free_cb(const Eina_Hash *hash __UNUSED__, const void *key __UNUSED__, void *data, void *fdata __UNUSED__)
|
||||||
{
|
{
|
||||||
eina_list_free((Eina_List *)data);
|
eina_list_free((Eina_List *)data);
|
||||||
return EINA_TRUE;
|
return EINA_TRUE;
|
||||||
|
|
Loading…
Reference in New Issue