Skip to content

Commit 0c0d1fd

Browse files
committed
v8: document some functions
1 parent b2927cb commit 0c0d1fd

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

crates/core/src/host/v8/mod.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,8 @@ impl ModuleInstance for JsInstance {
201201
}
202202
}
203203

204+
/// Spawns a thread that will terminate reducer execution
205+
/// when `budget` has been used up.
204206
fn run_reducer_timeout(isolate_handle: IsolateHandle, budget: ReducerBudget) -> Arc<AtomicBool> {
205207
let execution_done_flag = Arc::new(AtomicBool::new(false));
206208
let execution_done_flag2 = execution_done_flag.clone();
@@ -224,12 +226,14 @@ fn run_reducer_timeout(isolate_handle: IsolateHandle, budget: ReducerBudget) ->
224226
execution_done_flag
225227
}
226228

229+
/// Converts a [`ReducerBudget`] to a [`Duration`].
227230
fn budget_to_duration(_budget: ReducerBudget) -> Duration {
228231
// TODO(v8): This is fake logic that allows a maximum timeout.
229232
// Replace with sensible math.
230233
Duration::MAX
231234
}
232235

236+
/// Converts a [`Duration`] to a [`ReducerBudget`].
233237
fn duration_to_budget(_duration: Duration) -> ReducerBudget {
234238
// TODO(v8): This is fake logic that allows minimum energy usage.
235239
// Replace with sensible math.

0 commit comments

Comments
 (0)