cdecl keyword

James Van Artsdalen james at bigtex.uucp
Mon Apr 4 07:33:23 AEST 1988


IN article <185 at premise.ZONE1.COM>, chang at premise.ZONE1.COM (John Chang) wrote:
> >  [...] C uses pass-by-value for everything.
> 		                    ^^^^^^^^^^ What about arrays? 

In C, arrays are _never_ passed to functions.  Only the addresses of arrays.
These are passed by value only.

> The extra instruction needed to pop the stack after a function call
> seems unimportant, yet I once heard Microsoft claim that the change to
> pascal calling convention made Microsoft Windows "substantially"
> smaller and faster.  I don't remember the figures, but they were
> hard to believe.

Hard to believe, but true.  Ultima IV became several K smaller and noticeably
quicker after the conversion.  Unfortunately, I don't remember the numbers
either, but it was enough to be worth the trouble (though to be fair, a game
must make especially pessimistic assumptions concerning available memory and
processor speed).
-- 
James R. Van Artsdalen    ...!uunet!utastro!bigtex!james     "Live Free or Die"
Home: 512-346-2444 Work: 328-0282; 110 Wild Basin Rd. Ste #230, Austin TX 78746



More information about the Comp.lang.c mailing list