[Scummvm-devel] SCI mem functions

Joost Peters joostp at 7fc1.org
Tue Feb 17 19:41:49 CET 2009


Filippos Karapetis schreef:

> Well... in that case we should either have similar wrappers for the rest 
> of the ScummVM code,
> or perform alternate kind of testing, or no testing at all...

Aye.  *Ideally* all engines/code would check the return value of 
malloc/new in all places it is used, and give "out of memory" errors, 
rather than crashing in obscure ways, like they often do now.  A generic 
wrapper could be useful, but also problematic, as was pointed out before.

> Moreover, a lot of engines run relatively well in memory-constrained 
> platforms without the
> need for such checks.

Sure, many do, and a few don't.   If you look into the bugs reported for 
DS, especially in the early days, often games would simply freeze when 
out of memory.

Anyway, I merely wanted to point out the fact that you can't expect 
malloc() to always succeed, in response to your statement that it should 
never fail, unless there is a leak. :)


Cheers,
Joost





More information about the Scummvm-devel mailing list