You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: graalwasm/graalwasm-embed-c-code-guide/README.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -182,10 +182,10 @@ public class App {
182
182
183
183
## 4. Using Java functions from WebAssembly
184
184
185
-
You can also call Java functions from WebAssembly by importing them in your WebAssembly modules.
186
-
For the sake of an example, let's try to move the logic which computes the next element of the output (by doing an integer increment) to a Java function.
185
+
You can also call Java functions from WebAssembly by importing them into your WebAssembly modules.
186
+
For this example, let's try to move the logic which computes the next element of the output (by doing an integer increment) to a Java function.
187
187
188
-
Here is what we will need to add to our C file to declare an external function whose implementation we will provide in Java:
188
+
We need to add the following to our C file to declare an external function whose implementation we will provide in Java:
189
189
190
190
```c
191
191
externintjavaInc(int number)
@@ -196,7 +196,7 @@ __attribute__((
196
196
```
197
197
198
198
This introduces an import in the resulting WebAssembly module.
199
-
The import will try to pull a function named `java-increment` from the imported module `env`.
199
+
The import will pull a function named `java-increment` from the imported module `env`.
200
200
Within our C code, this function will be available under the name `javaInc`.
201
201
We can update our `floyd` function to use `javaInc` like so:
0 commit comments