Pascal calling convention !!
-
How does using the Pascal calling convention reduce memory requirement ? All the Books state this, but not how - except that the parameters are pushed from left to right to the stack.
I am not sure but i think that it has to do with the way that functions release heap memory. - - - - - - - - - - - - - - - - - - Memory leaks is the price we pay \0 01234567890123456789012345678901234
-
How does using the Pascal calling convention reduce memory requirement ? All the Books state this, but not how - except that the parameters are pushed from left to right to the stack.
AFAIK it's because in Pascal cc it's the callee that cleans up the stack while in C-type cc it's the caller. So the clean-up code is duplicated for each call in C-type cc while it's present only once (at the end of the function) in Pascal cc. This is also why Pascal cc cannot handle a variable number of arguments (how's the callee supposed to know?). Cheers Steen. "To claim that computer games influence children is rediculous. If Pacman had influenced children born in the 80'ies we would see a lot of youngsters running around in dark rooms eating pills while listening to monotonous music"
-
AFAIK it's because in Pascal cc it's the callee that cleans up the stack while in C-type cc it's the caller. So the clean-up code is duplicated for each call in C-type cc while it's present only once (at the end of the function) in Pascal cc. This is also why Pascal cc cannot handle a variable number of arguments (how's the callee supposed to know?). Cheers Steen. "To claim that computer games influence children is rediculous. If Pacman had influenced children born in the 80'ies we would see a lot of youngsters running around in dark rooms eating pills while listening to monotonous music"
Correct. Stephen Kellett -- C++/Java/Win NT/Unix variants Memory leaks/corruptions/performance/system problems. UK based. Problems with RSI/WRULD? Contact me for advice.