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:
@ -40,7 +40,7 @@ hmu_is_in_heap(void *hmu, gc_uint8 *heap_base_addr, gc_uint8 *heap_end_addr)
|
||||
* the node will be removed from the tree, and the left, right and
|
||||
* parent pointers of the node @p will be set to be NULL. Other fields
|
||||
* won't be touched. The tree will be re-organized so that the order
|
||||
* conditions are still satisified.
|
||||
* conditions are still satisfied.
|
||||
*/
|
||||
static bool
|
||||
remove_tree_node(gc_heap_t *heap, hmu_tree_node_t *p)
|
||||
@ -648,7 +648,7 @@ gc_realloc_vo_internal(void *vheap, void *ptr, gc_size_t size, const char *file,
|
||||
hmu_old = obj_to_hmu(obj_old);
|
||||
tot_size_old = hmu_get_size(hmu_old);
|
||||
if (tot_size <= tot_size_old)
|
||||
/* current node alreay meets requirement */
|
||||
/* current node already meets requirement */
|
||||
return obj_old;
|
||||
}
|
||||
|
||||
|
||||
@ -115,7 +115,7 @@ gc_init_with_struct_and_pool(char *struct_buf, gc_size_t struct_buf_size,
|
||||
char *pool_buf, gc_size_t pool_buf_size);
|
||||
|
||||
/**
|
||||
* Destroy heap which is initilized from a buffer
|
||||
* Destroy heap which is initialized from a buffer
|
||||
*
|
||||
* @param handle handle to heap needed destroy
|
||||
*
|
||||
|
||||
@ -287,7 +287,7 @@ typedef struct gc_heap_struct {
|
||||
additional memory fails. When the fast mode fails, the
|
||||
marking process can still be done in the slow mode, which
|
||||
doesn't need additional memory (by walking through all
|
||||
blocks and marking sucessors of marked nodes until no new
|
||||
blocks and marking successors of marked nodes until no new
|
||||
node is marked). TODO: slow mode is not implemented. */
|
||||
unsigned is_fast_marking_failed : 1;
|
||||
|
||||
@ -319,7 +319,7 @@ typedef struct gc_heap_struct {
|
||||
* the nodes, a new space will be allocated from heap */
|
||||
extra_info_node_t *extra_info_normal_nodes[EXTRA_INFO_NORMAL_NODE_CNT];
|
||||
/* Used to store extra information such as finalizer for specified nodes, we
|
||||
* introduce a seperate space to store these information so only nodes who
|
||||
* introduce a separate space to store these information so only nodes who
|
||||
* really require extra information will occupy additional memory spaces. */
|
||||
extra_info_node_t **extra_info_nodes;
|
||||
gc_size_t extra_info_node_cnt;
|
||||
|
||||
@ -9,7 +9,7 @@
|
||||
|
||||
/**
|
||||
* Set default value to prefix and suffix
|
||||
* @param hmu should not be NULL and should have been correctly initilized
|
||||
* @param hmu should not be NULL and should have been correctly initialized
|
||||
* (except prefix and suffix part)
|
||||
* @param tot_size is offered here because hmu_get_size can not be used
|
||||
* till now. tot_size should not be smaller than OBJ_EXTRA_SIZE.
|
||||
|
||||
@ -232,7 +232,7 @@ gc_migrate(gc_handle_t handle, char *pool_buf_new, gc_size_t pool_buf_size)
|
||||
heap_max_size = (uint32)(pool_buf_end - base_addr_new) & (uint32)~7;
|
||||
|
||||
if (pool_buf_end < base_addr_new || heap_max_size < heap->current_size) {
|
||||
LOG_ERROR("[GC_ERROR]heap migrate invlaid pool buf size\n");
|
||||
LOG_ERROR("[GC_ERROR]heap migrate invalid pool buf size\n");
|
||||
return GC_ERROR;
|
||||
}
|
||||
|
||||
|
||||
@ -495,7 +495,7 @@ os_thread_jit_write_protect_np(bool enabled)
|
||||
#define SIG_ALT_STACK_SIZE (32 * 1024)
|
||||
|
||||
/**
|
||||
* Whether thread signal enviornment is initialized:
|
||||
* Whether thread signal environment is initialized:
|
||||
* the signal handler is registered, the stack pages are touched,
|
||||
* the stack guard pages are set and signal alternate stack are set.
|
||||
*/
|
||||
@ -696,7 +696,7 @@ os_thread_signal_init(os_signal_handler handler)
|
||||
memset(&prev_sig_act_SIGSEGV, 0, sizeof(struct sigaction));
|
||||
memset(&prev_sig_act_SIGBUS, 0, sizeof(struct sigaction));
|
||||
|
||||
/* Install signal hanlder */
|
||||
/* Install signal handler */
|
||||
sig_act.sa_sigaction = signal_callback;
|
||||
sig_act.sa_flags = SA_SIGINFO | SA_NODEFER;
|
||||
#if WASM_DISABLE_STACK_HW_BOUND_CHECK == 0
|
||||
|
||||
@ -209,7 +209,7 @@ int
|
||||
os_cond_wait(korp_cond *cond, korp_mutex *mutex);
|
||||
|
||||
/**
|
||||
* Wait a condition varible or return if time specified passes.
|
||||
* Wait a condition variable or return if time specified passes.
|
||||
*
|
||||
* @param cond pointer to condition variable
|
||||
* @param mutex pointer to mutex to protect the condition variable
|
||||
@ -766,7 +766,7 @@ int
|
||||
os_socket_get_recv_timeout(bh_socket_t socket, uint64 *timeout_us);
|
||||
|
||||
/**
|
||||
* Enable re-use of local addresses
|
||||
* Enable reuse of local addresses
|
||||
*
|
||||
* @param socket the socket to set
|
||||
* @param is_enabled 1 to enable or 0 to disable
|
||||
@ -777,7 +777,7 @@ int
|
||||
os_socket_set_reuse_addr(bh_socket_t socket, bool is_enabled);
|
||||
|
||||
/**
|
||||
* Get whether re-use of local addresses is enabled
|
||||
* Get whether reuse of local addresses is enabled
|
||||
*
|
||||
* @param socket the socket to set
|
||||
* @param is_enabled 1 for enabled or 0 for disabled
|
||||
@ -788,7 +788,7 @@ int
|
||||
os_socket_get_reuse_addr(bh_socket_t socket, bool *is_enabled);
|
||||
|
||||
/**
|
||||
* Enable re-use of local ports
|
||||
* Enable reuse of local ports
|
||||
*
|
||||
* @param socket the socket to set
|
||||
* @param is_enabled 1 to enable or 0 to disable
|
||||
@ -799,7 +799,7 @@ int
|
||||
os_socket_set_reuse_port(bh_socket_t socket, bool is_enabled);
|
||||
|
||||
/**
|
||||
* Get whether re-use of local ports is enabled
|
||||
* Get whether reuse of local ports is enabled
|
||||
*
|
||||
* @param socket the socket to set
|
||||
* @param is_enabled 1 for enabled or 0 for disabled
|
||||
@ -1120,7 +1120,7 @@ os_dumps_proc_mem_info(char *out, unsigned int size);
|
||||
|
||||
/**
|
||||
* NOTES:
|
||||
* Fileystem APIs are required for WASI libc support. If you don't need to
|
||||
* Filesystem APIs are required for WASI libc support. If you don't need to
|
||||
* support WASI libc, there is no need to implement these APIs. With a
|
||||
* few exceptions, each filesystem function has been named after the equivalent
|
||||
* POSIX filesystem function with an os_ prefix.
|
||||
@ -1134,12 +1134,12 @@ os_dumps_proc_mem_info(char *out, unsigned int size);
|
||||
* os_file_handle: the file handle type used in the WASI libc fd
|
||||
* table. Filesystem implementations can use it as a means to store any
|
||||
* necessary platform-specific information which may not be directly available
|
||||
* through the raw OS file handle. Similiar to POSIX file descriptors, file
|
||||
* through the raw OS file handle. Similar to POSIX file descriptors, file
|
||||
* handles may also refer to sockets, directories, symbolic links or character
|
||||
* devices and any of the filesystem operations which make sense for these
|
||||
* resource types should be supported as far as possible.
|
||||
*
|
||||
* os_dir_stream: a directory stream type in which fileystem implementations
|
||||
* os_dir_stream: a directory stream type in which filesystem implementations
|
||||
* can store any necessary state to iterate over the entries in a directory.
|
||||
*/
|
||||
|
||||
@ -1166,7 +1166,7 @@ os_fstatat(os_file_handle handle, const char *path,
|
||||
struct __wasi_filestat_t *buf, __wasi_lookupflags_t lookup_flags);
|
||||
|
||||
/**
|
||||
* Obtain the file status flags for the provided handle. This is similiar to the
|
||||
* Obtain the file status flags for the provided handle. This is similar to the
|
||||
* POSIX function fcntl called with the F_GETFL command.
|
||||
*
|
||||
* @param handle the handle for which to obtain the file status flags
|
||||
@ -1176,7 +1176,7 @@ __wasi_errno_t
|
||||
os_file_get_fdflags(os_file_handle handle, __wasi_fdflags_t *flags);
|
||||
|
||||
/**
|
||||
* Set the file status flags for the provided handle. This is similiar to the
|
||||
* Set the file status flags for the provided handle. This is similar to the
|
||||
* POSIX function fcntl called with the F_SETFL command.
|
||||
*
|
||||
* @param handle the handle for which to set the file status flags
|
||||
@ -1235,7 +1235,7 @@ os_openat(os_file_handle handle, const char *path, __wasi_oflags_t oflags,
|
||||
wasi_libc_file_access_mode access_mode, os_file_handle *out);
|
||||
|
||||
/**
|
||||
* Obtain the file access mode for the provided handle. This is similiar to the
|
||||
* Obtain the file access mode for the provided handle. This is similar to the
|
||||
* POSIX function fcntl called with the F_GETFL command combined with the
|
||||
* O_ACCMODE mask.
|
||||
*
|
||||
@ -1480,9 +1480,9 @@ os_file_handle
|
||||
os_convert_stdin_handle(os_raw_file_handle raw_stdin);
|
||||
|
||||
/**
|
||||
* Converts a raw file handle to STDOUT to a correponding file handle to STDOUT.
|
||||
* If the provided raw file handle is invalid, the platform-default raw handle
|
||||
* for STDOUT will be used.
|
||||
* Converts a raw file handle to STDOUT to a corresponding file handle to
|
||||
* STDOUT. If the provided raw file handle is invalid, the platform-default raw
|
||||
* handle for STDOUT will be used.
|
||||
*
|
||||
* @param raw_stdout a raw file handle to STDOUT
|
||||
*
|
||||
@ -1492,9 +1492,9 @@ os_file_handle
|
||||
os_convert_stdout_handle(os_raw_file_handle raw_stdout);
|
||||
|
||||
/**
|
||||
* Converts a raw file handle to STDERR to a correponding file handle to STDERR.
|
||||
* If the provided raw file handle is invalid, the platform-default raw handle
|
||||
* for STDERR will be used.
|
||||
* Converts a raw file handle to STDERR to a corresponding file handle to
|
||||
* STDERR. If the provided raw file handle is invalid, the platform-default raw
|
||||
* handle for STDERR will be used.
|
||||
*
|
||||
* @param raw_stderr a raw file handle to STDERR
|
||||
*
|
||||
|
||||
@ -53,7 +53,7 @@ convert_sgx_errno(int error)
|
||||
* continue (only used when no EXXX is returned) */
|
||||
case SGX_ERROR_FILE_CANT_WRITE_RECOVERY_FILE:
|
||||
return EIO;
|
||||
/* When openeing the file, recovery is needed, but the recovery
|
||||
/* When opening the file, recovery is needed, but the recovery
|
||||
* process failed */
|
||||
case SGX_ERROR_FILE_RECOVERY_NEEDED:
|
||||
return EIO;
|
||||
|
||||
@ -51,7 +51,7 @@ extern "C" {
|
||||
#define TCP_DEFER_ACCEPT 9 /* Wake up listener only when data arrive */
|
||||
#define TCP_WINDOW_CLAMP 10 /* Bound advertised window */
|
||||
#define TCP_INFO 11 /* Information about this connection. */
|
||||
#define TCP_QUICKACK 12 /* Bock/reenable quick ACKs. */
|
||||
#define TCP_QUICKACK 12 /* Bock/re-enable quick ACKs. */
|
||||
#define TCP_CONGESTION 13 /* Congestion control algorithm. */
|
||||
#define TCP_MD5SIG 14 /* TCP MD5 Signature (RFC2385) */
|
||||
#define TCP_COOKIE_TRANSACTIONS 15 /* TCP Cookie Transactions */
|
||||
|
||||
@ -282,7 +282,7 @@ os_thread_join(korp_tid thread, void **value_ptr)
|
||||
mutex_unlock(&thread_data->wait_list_lock);
|
||||
|
||||
sema_wait(&node.sem);
|
||||
// get the return value pointer conted may not be availible after return
|
||||
// get the return value pointer conted may not be available after return
|
||||
if (value_ptr)
|
||||
(*value_ptr) = node.ret;
|
||||
/* Wait some time for the thread to be actually terminated */
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
|
||||
#if BH_DEBUG != 0
|
||||
/**
|
||||
* Test whehter a pointer value has exist in given list.
|
||||
* Test whether a pointer value has exist in given list.
|
||||
*
|
||||
* @param list pointer to list.
|
||||
* @param elem pointer to elem that will be inserted into list.
|
||||
|
||||
Reference in New Issue
Block a user