add doctest for with_stacks
This commit is contained in:
parent
94a62c2c20
commit
0498125070
|
@ -183,6 +183,21 @@ impl Interpreter {
|
||||||
/// Initialize an interpreter that will use `value_stack` and `call_stack`.
|
/// Initialize an interpreter that will use `value_stack` and `call_stack`.
|
||||||
///
|
///
|
||||||
/// `value_stack` `call_stack` determine the allowed stack size during later executions.
|
/// `value_stack` `call_stack` determine the allowed stack size during later executions.
|
||||||
|
///
|
||||||
|
/// ```
|
||||||
|
/// # extern crate wasmi;
|
||||||
|
/// use wasmi::{Interpreter, StackWithLimit, StackSize};
|
||||||
|
/// let interpreter = Interpreter::with_stacks(
|
||||||
|
/// StackWithLimit::with_size(StackSize::from_byte_count(8192)),
|
||||||
|
/// StackWithLimit::with_size(StackSize::from_element_count(2048)),
|
||||||
|
/// );
|
||||||
|
/// # let value_stack_size = StackSize::from_byte_count(8192);
|
||||||
|
/// # let value_stack = StackWithLimit::with_size(value_stack_size);
|
||||||
|
/// # let interpreter = Interpreter::with_stacks(
|
||||||
|
/// # value_stack,
|
||||||
|
/// # StackWithLimit::with_size(StackSize::from_element_count(2048)),
|
||||||
|
/// # );
|
||||||
|
/// ```
|
||||||
pub fn with_stacks(
|
pub fn with_stacks(
|
||||||
value_stack: StackWithLimit<RuntimeValueInternal>,
|
value_stack: StackWithLimit<RuntimeValueInternal>,
|
||||||
call_stack: StackWithLimit<FunctionContext>,
|
call_stack: StackWithLimit<FunctionContext>,
|
||||||
|
|
Loading…
Reference in New Issue