Performance annotations: add attributes @_noLocks and @_noAllocation

This commit is contained in:
Erik Eckstein
2021-10-21 22:04:27 +02:00
parent 60f3d61031
commit 8229b374b1
16 changed files with 113 additions and 11 deletions

View File

@@ -625,3 +625,12 @@ for more details.
Marks a var decl as a variable that must be copied explicitly using the builtin
function Builtin.copy.
## `@_noAllocation`, `@_noLocks`
These attributes are performance annotations. If a function is annotated with
such an attribute, the compiler issues a diagnostic message if the function
calls a runtime function which allocates memory or locks, respectively.
The `@_noLocks` attribute implies `@_noAllocation` because a memory allocation
also locks.