[PATCH 1/5] d3dx9_36: Implement D3DXFileCreate. (try 3)

Dmitry Timoshkov dmitry at baikal.ru
Wed Oct 24 11:18:37 CDT 2012


Rico Schüller <kgbricola at web.de> wrote:

> >>>> +    if (!object)
> >>>> +    {
> >>>> +        ERR("Out of memory\n");
> >>>> +        return E_OUTOFMEMORY;
> >>>> +    }
> >>>
> >>> The ERR() is useless here, just return E_OUTOFMEMORY in such situations.
> >>>
> >>>
> >>>
> >> It's done this way in many places in wine.
> >
> > Then that other places need to be fixed as well. Printing an ERR() on memory
> > allocation errors is not helpful.
> >
> In which cases do you use ERR? I thought it is used, when there are 
> system errors. And I think ERR is fine for out of memory, because the 
> system is not able to hand out the needed memory. Just do a git grep. 
> There are ~400 usages for ERR and out of memory... What's your 
> suggestion how to do that with the "Out of memory"?

A much more illustrative thing that happens after an out of memory
condition is a crash followed by a backtrace (if the caller does not
handle it gracefully), printing an ERR() is completely useless in that
case, and provides no useful information.

-- 
Dmitry.



More information about the wine-devel mailing list