The calls via mega_apply aren't the problem. Rather it's those that use low_mega_apply and low_return at different points, i.e. whenever a pike function calls another pike function. I don't think that has changed. Wasn't it you that implemented the stuff that avoids recursion on the C stack in that case?
/ Martin Stjernholm, Roxen IS
Previous text:
2003-08-08 01:36: Subject: Machine code efficiency
Another option would be to put the responsibility of popping the frame on the caller. But that would probably screw things up...
Hmm, when I read my copy of an early pike 7.4, it seems that this is how it used to work whenever the function call originated from mega_apply(). Tail recursion would cause F_RETURN to free the frame, but in a tailrecursion call there would always be at least one more reference to the current program, so that shouldn't be a problem.
I assume this has changed? (Too lazy to read the new source right now...)
/ Fredrik (Naranek) Hubinette (Real Build Master)