Use of Restrictions (GNAT User’s Guide for Native Platforms)

#### 6.3.1.2 Use of Restrictions ¶

You can use pragma Restrictions to control which features are permitted in your program. In most cases, the use of this pragma itself does not affect the generated code (but, of course, if you avoid relatively expensive features like finalization, you’ll have more efficient programs and that’s enforceable by the use of pragma Restrictions (No_Finalization).

One notable exception to this rule is that the possibility of task abort results in some distributed overhead, particularly if finalization or exception handlers are used. This is because certain sections of code must be marked as non-abortable.

If you use neither the `abort` statement nor asynchronous transfer of control (`select ... then abort`), this distributed overhead can be removed, which may have a general positive effect in improving overall performance, especially in code involving frequent use of tasking constructs and controlled types, which will show much improved performance. The relevant restrictions pragmas are

>     pragma Restrictions (No_Abort_Statements);
>     pragma Restrictions (Max_Asynchronous_Select_Nesting => 0);

We recommend that you use these restriction pragmas if possible. If you do this, it also means you can write code without worrying about the possibility of an immediate abort at any point.