There is some special handling involved in that the code inside the try part (I think) is effectively a nested procedure.  It's important in the context of stack unwinding when an exception occurs.  There is a performance penalty when using them, which one reason why the compiler sources don't use them.  There's probably other reasons too.  There might be some speed-up potential where standard Exit calls are concerned, but I'm not sure.

Gareth aka. Kit

On 06/05/2021 23:17, Ryan Joseph via fpc-devel wrote:

On May 6, 2021, at 4:05 PM, Sven Barth via fpc-devel 
<> wrote:

Other than that, you're right and what Ryan is trying to do is definitely the 
intended purpose of try ... finally.

Is there any runtime code involved with try..finally or does it just reorganize 
the code to run at the end of the block? My understanding of the defer keyword 
is that is was just a fancy way to move some code into a block which always 
gets run with a function exits.

        Ryan Joseph

fpc-devel maillist  -

This email has been checked for viruses by Avast antivirus software.

fpc-devel maillist  -

Reply via email to