@@ -15,26 +15,40 @@ Current Unstable ABI
15
15
There are two kinds of modules:
16
16
17
17
- A * command* exports a function named ` _start ` , with no arguments and no return
18
- values. Environments shall call this function once, after instantiating the
19
- module and all of its dependencies. After this function exits, the instance
20
- is considered terminated and no further use of any of its exports should be
21
- permitted.
18
+ values.
22
19
23
- - A * reactor* exports a function named ` _initialize ` , with no arguments and no
24
- return values. Environments shall call this function once, after instantiating
25
- the module and all of its dependencies. After this function exits, the instance
26
- remains live, and its exports may be accessed.
20
+ Command instances may assume that they will be called from the environment
21
+ at most once. Command instances may assume that none of their exports are
22
+ accessed outside the duraction of that call.
23
+
24
+ - All other modules are * reactors* . A reactor may export a function named
25
+ ` _initialize ` , with no arguments and no return values.
26
+
27
+ If an ` _initialize ` export is present, reactor instances may assume that it
28
+ will be called by the environment at most once, and that none of their
29
+ other exports are accessed before that call.
30
+
31
+ After being instantiated, and after any ` _initialize ` function is called,
32
+ a reactor instance remains live, and its exports may be accessed.
27
33
28
34
These kinds are mutually exclusive; implementations should report an error if
29
35
asked to instantiate a module containing exports which declare it to be of
30
36
multiple kinds.
31
37
32
- Regardless of the kind, all programs accessing WASI APIs also export a linear
33
- memory with the name ` memory ` . Pointers in WASI API calls are relative to this
34
- memory's index space.
38
+ Regardless of the kind, all modules accessing WASI APIs also export a linear
39
+ memory with the name ` memory ` . Data pointers in WASI API calls are relative to
40
+ this memory's index space.
41
+
42
+ Regardless of the kind, all modules accessing WASI APIs also export a table
43
+ with the name ` __indirect_function_table ` . Function pointers in WASI API calls
44
+ are relative to this table's index space.
45
+
46
+ Environments shall not access exports named ` __heap_base ` or ` __data_end ` .
47
+ Toolchains are encouraged to avoid providing these exports.
35
48
36
49
In the future, as the underlying WebAssembly platform offers more features, we
37
- we hope to eliminate the requirement to export all of linear memory.
50
+ we hope to eliminate the requirement to export all of linear memory or all of
51
+ the indirect function table.
38
52
39
53
Planned Stable ABI
40
54
------------------
0 commit comments