evas: fix increased memory usage in Evas.

Eina_Cow does memory comparison during standby time. So in expedite as we don't
have any standby time, we end up allocating some vast amount of memory that
will never be compared. It is way simpler to compare that the data are not
going to change before hand. It should also reduce the CPU consumed during
idle time.

This patch save about 1MB of data at peak time in expedite.
This commit is contained in:
Cedric BAIL 2014-10-29 06:15:11 +01:00
parent eb11a157ec
commit c3b4a573a2
2 changed files with 18 additions and 8 deletions

View File

@ -280,11 +280,16 @@ Eina_Cow *evas_object_image_state_cow = NULL;
static void
_evas_object_image_cleanup(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj, Evas_Image_Data *o)
{
EINA_COW_IMAGE_STATE_WRITE_BEGIN(o, state_write)
/* Eina_Cow doesn't know if the resulting memory has changed, better check
before we change it */
if (o->cur->opaque_valid)
{
state_write->opaque_valid = 0;
EINA_COW_IMAGE_STATE_WRITE_BEGIN(o, state_write)
{
state_write->opaque_valid = 0;
}
EINA_COW_IMAGE_STATE_WRITE_END(o, state_write);
}
EINA_COW_IMAGE_STATE_WRITE_END(o, state_write);
if ((o->preloading) && (o->engine_data))
{

View File

@ -687,13 +687,18 @@ _evas_object_eo_base_destructor(Eo *eo_obj, Evas_Object_Protected_Data *obj)
eo_do(proxy, evas_obj_text_filter_source_set(NULL, eo_obj));
}
EINA_COW_WRITE_BEGIN(evas_object_proxy_cow, obj->proxy,
Evas_Object_Proxy_Data, proxy_src)
/* Eina_Cow has no way to know if we are going to really change something
or not. So before calling the cow, let's check if we want to do something */
if (obj->proxy->proxy_textures)
{
EINA_LIST_FREE(proxy_src->proxy_textures, texture)
eo_do(texture, evas_3d_texture_source_set(NULL));
EINA_COW_WRITE_BEGIN(evas_object_proxy_cow, obj->proxy,
Evas_Object_Proxy_Data, proxy_src)
{
EINA_LIST_FREE(proxy_src->proxy_textures, texture)
eo_do(texture, evas_3d_texture_source_set(NULL));
}
EINA_COW_WRITE_END(evas_object_proxy_cow, obj->proxy, proxy_src);
}
EINA_COW_WRITE_END(evas_object_proxy_cow, obj->proxy, proxy_src);
if (obj->cur->clipper) evas_object_clip_unset(eo_obj);
evas_object_map_set(eo_obj, NULL);