Changes between Version 52 and Version 53 of Language


Ignore:
Timestamp:
05/23/23 11:09:41 (3 years ago)
Author:
siegel
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Language

    v52 v53  
    121121
    122122An atomic function must have a definition; in particular, neither a system function nor an abstract function may be declared using `$atomic_f`.
     123
     124The guard of an atomic function is taken to be the guard of the function's body.  For example, if `f` is defined
     125{{{
     126$atomic_f int f(int x) {
     127  $when (x>0);
     128  ...
     129}
     130}}}
     131then a call to `f` will block if the argument used in the call is not positive—no activation frame is pushed onto the stack unless the guard is true.
    123132
    124133=== System functions: `$system` #system
     
    732741Note that `malloc` is implemented as `$malloc($root, size)`.
    733742
    734 Function `$free` deallocates the object pointed to by `p`, which should be a pointer that was returned
    735 by an earlier call to `$malloc`.
     743Function `$free` deallocates the object pointed to by `p`, which should be a pointer that was returned by an earlier call to `$malloc`.
    736744An error is generated if the pointer is not one that was returned by $malloc, or if it was already freed.
    737745
     
    824832This clause has syntax
    825833  `executes_when` ''expr'' `;`
    826 It may be used with an [#atomic_f atomic] or [#system system] function.
     834It may be used with a [#system system function].
     835(For all other functions, this clause is ignored.)
    827836This clause specifies a guard that applies whenever the function is called.
    828837The ''expr'' is an ACSL expression and may use the formal parameters of the function as well as any other variables that are in scope.
     
    833842{{{
    834843\*@ executes_when \true; */
    835 void f() {...}
     844$system void f(int x);
    836845}}}
    837846