dev-comment spelling mistakes (#4434)

This commit is contained in:
Bernhard Schuster
2021-12-06 15:20:29 +01:00
committed by GitHub
parent 854d92a4a4
commit 4adb8466a3
26 changed files with 59 additions and 59 deletions
+3 -3
View File
@@ -34,7 +34,7 @@ const CONFIG: Config = Config {
// Besides `heap_pages` linear memory requests an initial number of pages. Those pages are
// typically used for placing the so-called shadow stack and the data section.
//
// By default, rustc (or lld specifically) allocates 1 MiB for the shadow stack. That is, 16
// By default, rustc (or `lld` specifically) allocates 1 MiB for the shadow stack. That is, 16
// wasm pages.
//
// Data section for runtimes are typically rather small and can fit in a single digit number of
@@ -51,7 +51,7 @@ const CONFIG: Config = Config {
cache_path: None,
semantics: Semantics {
fast_instance_reuse: false,
// Enable determinstic stack limit to pin down the exact number of items the wasmtime stack
// Enable deterministic stack limit to pin down the exact number of items the wasmtime stack
// can contain before it traps with stack overflow.
//
// Here is how the values below were chosen.
@@ -60,7 +60,7 @@ const CONFIG: Config = Config {
// (see the docs about the field and the instrumentation algorithm) is 8 bytes, 1 MiB can
// fit 2x 65536 logical items.
//
// Since reaching the native stack limit is undesirable, we halven the logical item limit and
// Since reaching the native stack limit is undesirable, we halve the logical item limit and
// also increase the native 256x. This hopefully should preclude wasm code from reaching
// the stack limit set by the wasmtime.
deterministic_stack_limit: Some(DeterministicStackLimit {
+4 -4
View File
@@ -145,7 +145,7 @@ pub struct Config {
impl Config {
/// Create a new instance of the configuration.
pub fn new(cache_path: std::path::PathBuf, program_path: std::path::PathBuf) -> Self {
// Do not contaminate the other parts of the codebase with the types from async_std.
// Do not contaminate the other parts of the codebase with the types from `async_std`.
let cache_path = PathBuf::from(cache_path);
let program_path = PathBuf::from(program_path);
@@ -378,7 +378,7 @@ async fn run(
// can be scheduled as a result of this function call, in case there are pending
// executions.
//
// We could be eager in terms of reporting and plumb the result from the prepartion
// We could be eager in terms of reporting and plumb the result from the preparation
// worker but we don't for the sake of simplicity.
break_if_fatal!(handle_prepare_done(
&cache_path,
@@ -1087,7 +1087,7 @@ mod tests {
// Received the precheck result.
assert_matches!(result_rx.now_or_never().unwrap().unwrap(), Ok(()));
// Send multiple requests for the same pvf.
// Send multiple requests for the same PVF.
let mut precheck_receivers = Vec::new();
for _ in 0..3 {
let (result_tx, result_rx) = oneshot::channel();
@@ -1121,7 +1121,7 @@ mod tests {
let mut host = test.host_handle();
// Test mixed cases of receiving execute and precheck requests
// for the same pvf.
// for the same PVF.
// Send PVF for the execution and request the prechecking for it.
let (result_tx, result_rx_execute) = oneshot::channel();
+3 -3
View File
@@ -251,7 +251,7 @@ async fn handle_enqueue(queue: &mut Queue, priority: Priority, pvf: Pvf) -> Resu
if let Some(available) = find_idle_worker(queue) {
// This may seem not fair (w.r.t priority) on the first glance, but it should be. This is
// because as soon as a worker finishes with the job it's immediatelly given the next one.
// because as soon as a worker finishes with the job it's immediately given the next one.
assign(queue, available, job).await?;
} else {
spawn_extra_worker(queue, priority.is_critical()).await?;
@@ -335,7 +335,7 @@ async fn handle_worker_concluded(
match $expr {
Some(v) => v,
None => {
// Precondition of calling this is that the $expr is never none;
// Precondition of calling this is that the `$expr` is never none;
// Assume the conditions holds, then this never is not hit;
// qed.
never!("never_none, {}", stringify!($expr));
@@ -794,7 +794,7 @@ mod tests {
let w1 = test.workers.insert(());
test.send_from_pool(pool::FromPool::Spawned(w1));
// Now, to the interesting part. After the queue normally issues the start_work command to
// Now, to the interesting part. After the queue normally issues the `start_work` command to
// the pool, before receiving the command the queue may report that the worker ripped.
assert_matches!(test.poll_and_recv_to_pool().await, pool::ToPool::StartWork { .. });
test.send_from_pool(pool::FromPool::Rip(w1));
+4 -4
View File
@@ -236,7 +236,7 @@ impl WorkerHandle {
// We don't expect the bytes to be ever read. But in case we do, we should not use a buffer
// of a small size, because otherwise if the child process does return any data we will end up
// issuing a syscall for each byte. We also prefer not to do allocate that on the stack, since
// each poll the buffer will be allocated and initialized (and that's due poll_read takes &mut [u8]
// each poll the buffer will be allocated and initialized (and that's due `poll_read` takes &mut [u8]
// and there are no guarantees that a `poll_read` won't ever read from there even though that's
// unlikely).
//
@@ -259,7 +259,7 @@ impl futures::Future for WorkerHandle {
let me = self.project();
match futures::ready!(AsyncRead::poll_read(me.stdout, cx, &mut *me.drop_box)) {
Ok(0) => {
// 0 means EOF means the child was terminated. Resolve.
// 0 means `EOF` means the child was terminated. Resolve.
Poll::Ready(())
},
Ok(_bytes_read) => {
@@ -268,7 +268,7 @@ impl futures::Future for WorkerHandle {
Poll::Pending
},
Err(_) => {
// The implementation is guaranteed to not to return WouldBlock and Interrupted. This
// The implementation is guaranteed to not to return `WouldBlock` and Interrupted. This
// leaves us with a legit errors which we suppose were due to termination.
Poll::Ready(())
},
@@ -284,7 +284,7 @@ impl fmt::Debug for WorkerHandle {
/// Convert the given path into a byte buffer.
pub fn path_to_bytes(path: &Path) -> &[u8] {
// Ideally, we take the OsStr of the path, send that and reconstruct this on the other side.
// Ideally, we take the `OsStr` of the path, send that and reconstruct this on the other side.
// However, libstd doesn't provide us with such an option. There are crates out there that
// allow for extraction of a path, but TBH it doesn't seem to be a real issue.
//