[fpc-pascal] Assert (in System) overhead

Peter Vreman peter at freepascal.org
Mon Apr 4 07:56:34 CEST 2005


> The System Unit provides the Assert procedures.  Code generation for
> Assert can be activated through a compiler switch or command-line option:
>
> 	<http://www.freepascal.org/docs-html/rtl/system/assert.html>
>
> However, if you do leave them in, what is the overhead?  In particular,
>
>   (1)  does the generated code always involve a procedure call,
>        or is the condition check inlined, and
>
>   (2)  is the (optional) message parameter (when present) always
> evaluated,
>        or only when the condition fails?
>
>>From the generated assembler listing of a small example, I get the
> impression that the check is inlined and the message parameter is
> evaluated only on failure.
>
> Can someone confirm that this is indeed always the way it is handled?

Confirmed









More information about the fpc-pascal mailing list