sd->item_cache = eina_inlist_remove(sd->item_cache, EINA_INLIST_GET(ic));
sd->item_cache_count--;
// Free should be performed after inlist is poped
- free(ic);
+ //TIZEN_ONLY(20191211): Mempool for genlist
+ eina_mempool_free(sd->_genlist_itemcache_mp, ic);
+ //
}
static void
_item_cache_free(sd, ic);
}
- ic = ELM_NEW(Item_Cache);
+ ic = eina_mempool_calloc(sd->_genlist_itemcache_mp, sizeof(Item_Cache));
if (!ic)
{
if (VIEW(it)) evas_object_del(VIEW(it));
eina_list_free(ic->contents);
ic->contents = NULL;
- free(ic);
+ //TIZEN_ONLY(20191211): Mempool for genlist
+ eina_mempool_free(sd->_genlist_itemcache_mp, ic);
+ //
return EINA_TRUE;
}
}
eina_inlist_remove(GL_IT(it)->wsd->blocks, il);
GL_IT(it)->wsd->blocks_realized = eina_list_remove
(GL_IT(it)->wsd->blocks_realized, itb);
- free(itb);
+ //TIZEN_ONLY(20191211): Mempool for genlist
+ eina_mempool_free(sd->_genlist_itemblock_mp, itb);
+ //
itb = NULL;
if (itbn) itbn->calc_done = EINA_FALSE;
}
(GL_IT(it)->wsd->blocks, EINA_INLIST_GET(itb));
GL_IT(it)->wsd->blocks_realized = eina_list_remove
(GL_IT(it)->wsd->blocks_realized, itb);
- free(itb);
+ //TIZEN_ONLY(20191211): Mempool for genlist
+ eina_mempool_free(sd->_genlist_itemblock_mp, itb);
+ //
block_changed = EINA_TRUE;
}
/* merge block with next */
EINA_INLIST_GET(itbn));
GL_IT(it)->wsd->blocks_realized = eina_list_remove
(GL_IT(it)->wsd->blocks_realized, itbn);
- free(itbn);
+ //TIZEN_ONLY(20191211): Mempool for genlist
+ eina_mempool_free(sd->_genlist_itemblock_mp, itbn);
+ //
block_changed = EINA_TRUE;
}
}
{
Item_Block *itb;
- itb = calloc(1, sizeof(Item_Block));
+ //TIZEN_ONLY(20191211): Mempool for genlist
+ itb = eina_mempool_calloc(sd->_genlist_itemblock_mp, sizeof(Item_Block));
+ //
if (!itb) return NULL;
itb->sd = sd;
if (prepend)
newblock:
if (GL_IT(it)->rel)
{
- itb = calloc(1, sizeof(Item_Block));
+ //TIZEN_ONLY(20191211): Mempool for genlist
+ itb = eina_mempool_calloc(sd->_genlist_itemblock_mp, sizeof(Item_Block));
+ //
if (!itb) return EINA_FALSE;
itb->sd = sd;
if (!GL_IT(it)->rel->item->block)
if (!done)
{
/* moving items to new block */
- itb2 = calloc(1, sizeof(Item_Block));
+ //TIZEN_ONLY(20191211): Mempool for genlist
+ itb2 = eina_mempool_calloc(sd->_genlist_itemblock_mp, sizeof(Item_Block));
+ //
if (!itb2) return EINA_FALSE;
itb2->sd = sd;
sd->blocks =
{
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
Evas_Coord minw, minh;
+ const char *choice, *tmp;
Elm_Genlist_Pan_Data *pan_data;
efl_canvas_group_add(efl_super(obj, MY_CLASS));
evas_object_smart_member_add(priv->hit_rect, obj);
elm_widget_sub_object_add(obj, priv->hit_rect);
+//TIZEN_ONLY(20191211): Mempool for genlist
+#ifdef EINA_DEFAULT_MEMPOOL
+ choice = "pass_through";
+#else
+ choice = "chained_mempool";
+#endif
+ tmp = getenv("EINA_MEMPOOL");
+ if (tmp && tmp[0])
+ choice = tmp;
+
+ priv->_genlist_itemdata_mp = eina_mempool_add
+ (choice, "genlist_item_data", NULL, sizeof(Elm_Gen_Item_Type), 128);
+ if (!priv->_genlist_itemdata_mp)
+ CRI("ERROR: Memory not enough for creating mempool for genlist items");
+
+ priv->_genlist_itemblock_mp = eina_mempool_add
+ (choice, "genlist_item_block", NULL, sizeof(Item_Block), 16);
+ if (!priv->_genlist_itemblock_mp)
+ {
+ eina_mempool_del(priv->_genlist_itemdata_mp);
+ priv->_genlist_itemdata_mp = NULL;
+ CRI("ERROR: Memory not enough for creating mempool for genlist item blocks");
+ }
+
+ priv->_genlist_itemcache_mp = eina_mempool_add
+ (choice, "genlist_item_cache", NULL, sizeof(Item_Cache), 16);
+ if (!priv->_genlist_itemcache_mp)
+ {
+ eina_mempool_del(priv->_genlist_itemdata_mp);
+ eina_mempool_del(priv->_genlist_itemblock_mp);
+ priv->_genlist_itemdata_mp = NULL;
+ priv->_genlist_itemblock_mp = NULL;
+ CRI("ERROR: Memory not enough for creating mempool for genlist item cache");
+ }
+//
+
/* common scroller hit rectangle setup */
evas_object_color_set(priv->hit_rect, 0, 0, 0, 0);
evas_object_show(priv->hit_rect);
if (sd->size_caches) eina_hash_free(sd->size_caches);
if (sd->decorate_it_type) eina_stringshare_del(sd->decorate_it_type);
if (sd->clipee) evas_object_del(sd->clipee);
+ //TIZEN_ONLY(20191211): Mempool for genlist
+ if (sd->_genlist_itemdata_mp) eina_mempool_del(sd->_genlist_itemdata_mp);
+ if (sd->_genlist_itemblock_mp) eina_mempool_del(sd->_genlist_itemblock_mp);
+ if (sd->_genlist_itemcache_mp) eina_mempool_del(sd->_genlist_itemcache_mp);
+ //
evas_object_del(sd->pan_obj);
efl_canvas_group_del(efl_super(obj, MY_CLASS));
}
elm_genlist_item_class_unref((Elm_Genlist_Item_Class *)it->itc);
- free(GL_IT(it));
+ //TIZEN_ONLY(20191211): Mempool for genlist
+ eina_mempool_free(sd->_genlist_itemdata_mp, GL_IT(it));
+ //
GL_IT(it) = NULL;
// TIZEN_ONLY(20150703) : banded color background feature. enabled only un-scrollable
it->func.func = func;
it->func.data = func_data;
- GL_IT(it) = ELM_NEW(Elm_Gen_Item_Type);
+ //TIZEN_ONLY(20191211): Mempool for genlist
+ GL_IT(it) = eina_mempool_calloc(sd->_genlist_itemdata_mp, sizeof(Elm_Gen_Item_Type));
+ //
GL_IT(it)->wsd = sd;
GL_IT(it)->type = type;