4 Sep
2003
4 Sep
'03
7:24 p.m.
On 4 Sep 2003, Mike Hearn wrote:
I removed the use of asserts to check the results, and replaced them with ERRs.
+ working_mem = GlobalAlloc(0, size); + if (!working_mem) { + ERR("failed to get a global alloc\n"); + return oldpos; + }
I don't think this is such a good idea. If the API can fail, it should just fail. ERR should be used only to signal internal inconsistencies. Doing an ERR on very memory allocation / function call that can fail is not only useless, but harmful, as it bloats and clutters the code. The above should just be: working_mem = GlobalAlloc(0, size); if (!working_mem) return oldpos; -- Dimi.