[Webkit-unassigned] [Bug 61423] [EFL] Eina_List out of memory handling
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Fri May 27 00:03:30 PDT 2011
https://bugs.webkit.org/show_bug.cgi?id=61423
--- Comment #8 from Grzegorz <g.czajkowski at samsung.com> 2011-05-27 00:03:30 PST ---
(In reply to comment #7)
> (In reply to comment #6)
> > Thanks for review. Sounds reasonably to separate OOM handling for each function. What will you say of following scenario:
> >
> > func() {
> >
> > eina_list_append();
> > if (eina_error_get())
> > goto out_of_memory_handling_func;
> >
> > // Out of memory handling for func()
> > out_of_memory_handling_func:
> > CRITICAL("%s", eina_error_msg_get(eina_error_get()));
> > void* _tmp_data;
> > EINA_LIST_FREE(list, _tmp_data)
> > method_for_free_item(_tmp_data) // like ewk_cookies_free(_tmp_data), ewk_context_menu_item_free(_tmp_data)
> > return ;
> > }
> >
> > A similar solution was proposed in html saving feature for OOM (bug id: 55455)
>
> That sounds better, indeed. Personally, I'd simply ignore errors which come from eina_list_append (or treat them all, which is infeasible), eina_list_append should not error out very often. Do you have some sort of setup which makes it fail more frequently than usual?
Generally WebKit-EFL checks return value from malloc (and friends functions). But it is done in simply cases only, for example ewk_view_paint_context_new, ewk_context_menu_item_new. If error occurred functions just return NULL.
It looks worse in cases where a new memory is created in iterations of loops. In the most cases the memory is added to Eina_List, for example ewk_cookies_get, ChromeClientEfl::runOpenPanel etc. I think we should accordingly check error status here too (from malloc, strdup, eina_list_append). As you mentioned in these cases return is not enough because it may affect memory leaks.
--
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
More information about the webkit-unassigned
mailing list