Alloc Expression
An alloc expression allocates storage for a value and yields a handle to it.
An alloc expression has the handle type &T, where T is the initializer expression's type.
Process
At runtime:
- enough space for a value of the initializer expression's type is allocated, see region allocation;
- the initializer expression is evaluated;
- its result is stored in the allocated space; and
- a handle to the newly allocated storage is returned.
Assertions
- The initializer expression's type is runtime representable.
Syntax
alloc_handle_expression = alloc, unary_expression ;