Rico Schüller kgbricola@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.