Changes between Version 52 and Version 53 of Language
- Timestamp:
- 05/23/23 11:09:41 (3 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Language
v52 v53 121 121 122 122 An atomic function must have a definition; in particular, neither a system function nor an abstract function may be declared using `$atomic_f`. 123 124 The 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 }}} 131 then 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. 123 132 124 133 === System functions: `$system` #system … … 732 741 Note that `malloc` is implemented as `$malloc($root, size)`. 733 742 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`. 743 Function `$free` deallocates the object pointed to by `p`, which should be a pointer that was returned by an earlier call to `$malloc`. 736 744 An error is generated if the pointer is not one that was returned by $malloc, or if it was already freed. 737 745 … … 824 832 This clause has syntax 825 833 `executes_when` ''expr'' `;` 826 It may be used with an [#atomic_f atomic] or [#system system] function. 834 It may be used with a [#system system function]. 835 (For all other functions, this clause is ignored.) 827 836 This clause specifies a guard that applies whenever the function is called. 828 837 The ''expr'' is an ACSL expression and may use the formal parameters of the function as well as any other variables that are in scope. … … 833 842 {{{ 834 843 \*@ executes_when \true; */ 835 void f() {...} 844 $system void f(int x); 836 845 }}} 837 846
