Free unused or rarely used glyph caches, in GC
We will start calculating memory allocated for font glyphs textures in EFL.
we will provide two public functions to set and get limitation for texture cache:
/** * Set the limit in bytes for texture allocated by font glyphs for evas (in case of accelerated rendering) * @param[in] bytes cache size in bytes, pass 0 to ignore the limit. * * @since 1.24 */ EAPI void evas_font_texture_cache_set(int bytes); /** * @} */ /** * Get the limit in bytes for texture allocated by font glyphs for evas (in case of accelerated rendering) * @return Returns font allocated texture cache limit. * @since 1.24 */ EAPI int evas_font_texture_cache_get();
When the limit is reached (actually 95%), we will request the GC to free up to 33% of the cache, in the next post-render cycle.
discussing this in IRC: 1- This could be added in **post-render** after **_cb_always_call(eo_e, e, EVAS_CALLBACK_RENDER_FLUSH_POST, NULL);** 2- The better way to do this by moving the gc to a thread. but this needs the font/glyphs to be thread-safe (locked)