[fpc-devel] Defer keyword

Ryan Joseph genericptr at gmail.com
Fri May 7 00:32:42 CEST 2021



> On May 6, 2021, at 4:26 PM, J. Gareth Moreton via fpc-devel <fpc-devel at lists.freepascal.org> wrote:
> 
> 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.

I just did a search and I did indeed see a few try..finally blocks but not many. As I understand it there is a "finalization" section of each procedure which is used for ref counted objects so I assumed the statement was merely moved to that location but I guess there's some concerns over exceptions.

Either way looking at the programming language landscape the better way forward seems to be some opt-in ARC for TObject but I don't know if the compiler team is receptive to that (Sven made some attempt years ago but abandoned it). it's kind of frustrating that we have ref counted types but that isn't extended to classes. Hopefully that's something we can tackle one of these days...

Regards,
	Ryan Joseph



More information about the fpc-devel mailing list