[fpc-pascal] $IMPLICITEXCEPTIONS vs early function return

Jonas Maebe jonas at freepascal.org
Sat Jul 15 18:17:56 CEST 2023

On 15/07/2023 16:53, Hairy Pixels via fpc-pascal wrote:
>> On Jul 15, 2023, at 7:18 AM, Jonas Maebe via fpc-pascal <fpc-pascal at lists.freepascal.org> wrote:
>> It also sets up an exception frame. FPC uses setjmp/longjmp for that, which means that while restoring everything when an exception happens is fast, saving the exception frame itself is relatively slow.
> Ok so just to confirm does disabling   $IMPLICITEXCEPTIONS leak memory with ref counted types if a function exists early?

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


More information about the fpc-pascal mailing list