Skip to content

Commit c6ba212

Browse files
authored
clarify canonopt requirements for async lifts (#575)
Signed-off-by: Joel Dice <[email protected]>
1 parent 66c9256 commit c6ba212

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

design/mvp/CanonicalABI.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3110,7 +3110,12 @@ validation is performed:
31103110
* requires options based on [`lift(param)`](#canonopt-validation) for all parameters in `ft`
31113111
* requires options based on [`lower(result)`](#canonopt-validation) if `ft` has a result
31123112
* if `len(flatten_types(ft.param_types())) > MAX_FLAT_PARAMS`, `realloc` is required
3113-
* if `len(flatten_types(ft.result_type())) > MAX_FLAT_RESULTS`, `memory` is required
3113+
* if `len(flatten_types(ft.result_type())) > max` (where `max = MAX_FLAT_RESULTS` for sync lifts, and `max = MAX_FLAT_PARAMS` for async lifts), `memory` is required
3114+
3115+
Note that an `async`-lifted function whose result type requires a memory to lift
3116+
(either because it contains lists or strings or because the number of flattened
3117+
types exceeds `MAX_FLAT_PARAMS`) must include a `memory` option, and that option
3118+
must exactly match that of the `task.return` built-in called at runtime.
31143119

31153120
When instantiating component instance `$inst`, `$f` is defined to be the
31163121
partially-bound closure `canon_lift($opts, $inst, $ft, $callee)` which has 3

0 commit comments

Comments
 (0)