[Scummvm-devel] ScummVM 1.0.0: Release status 2009-08-11 -- Full feature, freeze

Peter Bortas bortas at gmail.com
Fri Aug 14 18:28:39 CEST 2009


On Fri, Aug 14, 2009 at 2:04 PM, Andre Heider<a.heider at gmail.com> wrote:
> On Fri, Aug 14, 2009 at 12:09 PM, Bertrand
> Augereau<bertrand_augereau at yahoo.fr> wrote:
>> I am not a language lawyer and I don't have the standard by me now, but all the mallocs implementations I know return a valid pointer when doing malloc(0), with header and footer and so on : so at least practically you can expect an overhead.
>
> Without further research: IIRC the behaviour of malloc(0) is compiler
> implementation-defined and such a call should be avoided.
> Nevertheless, it should be okay to just exit Actor::loadFrameList() if
> framesCount equals zero.

Speaking of memory operations that doesn't make much sense, this
should probably go in:

zino at naween:~/hack-local/scummvm/scummvm/trunk/scummvm/branches/branch-1-0-0$
svn diff
Index: engines/tinsel/scene.cpp
===================================================================
--- engines/tinsel/scene.cpp    (revision 43367)
+++ engines/tinsel/scene.cpp    (working copy)
@@ -132,7 +132,7 @@

        // Copy appropriate fields into tempStruc, and return a pointer to it
        const byte *p = pStruc;
-       memset(&tempStruc, sizeof(SCENE_STRUC), 0);
+       memset(&tempStruc, 0, sizeof(SCENE_STRUC));

        tempStruc.numEntrance = READ_UINT32(p); p += sizeof(uint32);
        tempStruc.numPoly = READ_UINT32(p); p += sizeof(uint32);

Cheers,
-- 
Peter Bortas




More information about the Scummvm-devel mailing list