[fpc-pascal] $IMPLICITEXCEPTIONS vs early function return

Hairy Pixels genericptr at gmail.com
Sun Jul 16 19:37:29 CEST 2023



> On Jul 15, 2023, at 10:17 AM, Jonas Maebe via fpc-pascal <fpc-pascal at lists.freepascal.org> wrote:
> 
> No, local variables are still finalised on exiting the function. Only when an exception happens, the the exit code that contains this finalisation won't execute

So the trade off is exceptions put a cost on all functions but when they fire they can jump out of multiple stack frames and are faster then going back up the stack with normal returns (which clean up memory for you normal). I think that makes sense. Thanks.

Regards,
Ryan Joseph



More information about the fpc-pascal mailing list