fix: correct typos and improve comments across multiple files by codespell (#4116)

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
This commit is contained in:
Huang Qi
2025-03-07 08:21:54 +08:00
committed by GitHub
parent 73998e4c85
commit 412631ac13
108 changed files with 215 additions and 215 deletions

View File

@ -7,7 +7,7 @@
#include "wasm_export.h"
#include "math.h"
// The first parameter is not exec_env because it is invoked by native funtions
// The first parameter is not exec_env because it is invoked by native functions
void
reverse(char *str, int len)
{

View File

@ -30,7 +30,7 @@ $ ./FlameGraph/stackcollapse-perf.pl out.perf > out.folded
$ ./FlameGraph/flamegraph.pl out.folded > perf.svg
```
In this result, you'll see two modules's profiling result and all wasm functions are named as "aot_func#N" which is a little hard to distinguish.
In this result, you'll see two modules' profiling result and all wasm functions are named as "aot_func#N" which is a little hard to distinguish.
![perf.png](./pics/perf.png)

View File

@ -12,7 +12,7 @@ $ make
$ # It will build multi_module runtime and
$ # wasm file under the ./build .
$ # If you have built wamrc,
$ # aot file will also genrate.
$ # aot file will also generate.
$ ./multi_module mC.wasm
$ ...
$ ./multi_module mC.aot

View File

@ -2,7 +2,7 @@
This sample demonstrates how to write required interfaces in native library, build it into a shared library and register the shared library to iwasm.
The native library should provide `get_native_lib` API for iwasm to return the native library info, including the module name, the native symbol list and the native symbol count, so that iwasm can use them to regiter the native library, for example:
The native library should provide `get_native_lib` API for iwasm to return the native library info, including the module name, the native symbol list and the native symbol count, so that iwasm can use them to register the native library, for example:
```C
static int

View File

@ -1,5 +1,5 @@
# Examples of evidence verification without Intel SGX
Intel SGX evidence generated using WAMR can be validated on trusted plaforms without Intel SGX, or an Intel processors.
Intel SGX evidence generated using WAMR can be validated on trusted platforms without Intel SGX, or an Intel processors.
## Using C#
The sample [csharp/](csharp/) demonstrates such validation using C# as a managed language.

View File

@ -54,7 +54,7 @@ The output of client is like:
[Client] Connect socket
[Client] Client receive
[Client] 115 bytes received:
Buffer recieved:
Buffer received:
Say Hi from the Server
Say Hi from the Server
Say Hi from the Server
@ -117,7 +117,7 @@ The output is:
```bash
Wait for client to connect
Client connected, sleeping for 10s
Shuting down
Shutting down
```
```bash
@ -195,7 +195,7 @@ The output of client is like:
[Client] Create socket
[Client] Client send
[Client] Client receive
[Client] Buffer recieved: Hello from server
[Client] Buffer received: Hello from server
[Client] BYE
```

View File

@ -97,7 +97,7 @@ main(int argc, char *argv[])
printf("[Client] %d bytes received:\n", total_size);
if (total_size > 0) {
printf("Buffer recieved:\n%s\n", buffer);
printf("Buffer received:\n%s\n", buffer);
}
close(socket_fd);

View File

@ -37,7 +37,7 @@ run(void *arg)
}
}
printf("[Server] Shuting down the new connection #%u ..\n", new_socket);
printf("[Server] Shutting down the new connection #%u ..\n", new_socket);
shutdown(new_socket, SHUT_RDWR);
return NULL;
@ -137,14 +137,14 @@ main(int argc, char *argv[])
pthread_join(workers[i], NULL);
}
printf("[Server] Shuting down ..\n");
printf("[Server] Shutting down ..\n");
shutdown(socket_fd, SHUT_RDWR);
sleep(3);
printf("[Server] BYE \n");
return EXIT_SUCCESS;
fail:
printf("[Server] Shuting down ..\n");
printf("[Server] Shutting down ..\n");
if (socket_fd >= 0)
close(socket_fd);
sleep(3);

View File

@ -56,7 +56,7 @@ main(int argc, char *argv[])
printf("Client connected, sleeping for 10s\n");
sleep(10);
printf("Shuting down\n");
printf("Shutting down\n");
shutdown(client_socket_fd, SHUT_RDWR);
close(client_socket_fd);
shutdown(socket_fd, SHUT_RDWR);

View File

@ -75,7 +75,7 @@ main(int argc, char *argv[])
if (ret > 0) {
buffer[ret] = '\0';
printf("[Client] Buffer recieved: %s\n", buffer);
printf("[Client] Buffer received: %s\n", buffer);
}
close(socket_fd);

View File

@ -106,7 +106,7 @@ main(int argc, char *argv[])
printf("[Server] Achieve maximum amount of connections\n");
}
printf("[Server] Shuting down ..\n");
printf("[Server] Shutting down ..\n");
shutdown(socket_fd, SHUT_RDWR);
close(socket_fd);
sleep(3);
@ -114,7 +114,7 @@ main(int argc, char *argv[])
return EXIT_SUCCESS;
fail:
printf("[Server] Shuting down ..\n");
printf("[Server] Shutting down ..\n");
if (socket_fd >= 0)
close(socket_fd);
sleep(3);

View File

@ -93,14 +93,14 @@ also not economical to code for those functions.
Using module names as a filter seems to be a simple way. But some private
additional c/c++ libraries are supported in WAMR. Those supporting will bring
more import items that don't use `wasi_snapshot_preview1` as module names but are still
covered by the WASM runtime. Like `env.pthread_`. Plus, [the native lib registeration](https://github.com/bytecodealliance/wasm-micro-runtime/blob/main/doc/export_native_api.md)
covered by the WASM runtime. Like `env.pthread_`. Plus, [the native lib registration](https://github.com/bytecodealliance/wasm-micro-runtime/blob/main/doc/export_native_api.md)
provides another possible way to fill in the requirement of _the import section_.
Let's take summarize. A proper `wasm_extern_vec_t *imports` should include:
1. provides all necessary host implementations for items in _the import section_
2. should not override runtime provided implementation or covered by native
registrations. functinal or econmical.
registrations. functional or econmical.
3. keep them in a right order
## A recommendation

View File

@ -1,6 +1,6 @@
WAMR supports *wasm-c-api* in both *interpreter* mode and *aot* mode.
Before staring, we need to download and intall [WABT](https://github.com/WebAssembly/wabt/releases/latest).
Before staring, we need to download and install [WABT](https://github.com/WebAssembly/wabt/releases/latest).
``` shell
$ cd /opt

View File

@ -1,4 +1,4 @@
All workloads have similar requirment of software dependencies, including **emsdk** and **binaryen**
All workloads have similar requirement of software dependencies, including **emsdk** and **binaryen**
> There might be slight differences when using MacOS and other Linux distro than Ubuntu. This document targets
Ubuntu 20.04 as an example.