Class: Wasmtime::PoolingAllocationConfig

Inherits:
Object
  • Object
show all
Defined in:
ext/src/ruby_api/pooling_allocation_config.rs

Overview

Configuration options used with an engines ‘allocation_strategy` to change the behavior of the pooling instance allocator.

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.memory_protection_keys_available?Boolean

Returns:

  • (Boolean)


83
84
85
# File 'ext/src/ruby_api/pooling_allocation_config.rs', line 83

pub fn are_memory_protection_keys_available() -> Result<bool, Error> {
    Ok(wasmtime::PoolingAllocationConfig::are_memory_protection_keys_available())
}

.newWasmtime::PoolingAllocationConfig



27
28
29
30
31
32
33
34
35
# File 'ext/src/ruby_api/pooling_allocation_config.rs', line 27

pub fn new(ruby: &Ruby) -> Result<Obj<Self>, Error> {
    let obj = ruby.obj_wrap(Self::from(PoolingAllocationConfigImpl::default()));

    if ruby.block_given() {
        let _: Value = ruby.block_proc()?.call((obj,))?;
    }

    Ok(obj)
}

Instance Method Details

#async_stack_keep_resident=(amount) ⇒ Wasmtime::PoolingAllocationConfig

Parameters:

  • amount (Integer)

Returns:



91
92
93
94
95
96
97
# File 'ext/src/ruby_api/pooling_allocation_config.rs', line 91

pub fn set_async_stack_keep_resident(
    rb_self: Obj<Self>,
    amt: usize,
) -> Result<Obj<Self>, Error> {
    rb_self.borrow_mut()?.async_stack_keep_resident(amt);
    Ok(rb_self)
}

#max_memories_per_module=(max_memories) ⇒ Wasmtime::PoolingAllocationConfig

Parameters:

  • max_memories (Integer)

Returns:



60
61
62
63
64
65
66
# File 'ext/src/ruby_api/pooling_allocation_config.rs', line 60

pub fn set_max_memories_per_module(
    rb_self: Obj<Self>,
    max_memories: u32,
) -> Result<Obj<Self>, Error> {
    rb_self.borrow_mut()?.max_memories_per_module(max_memories);
    Ok(rb_self)
}

#max_tables_per_module=(max_tables) ⇒ Wasmtime::PoolingAllocationConfig

Parameters:

  • max_tables (Integer)

Returns:



72
73
74
75
76
77
78
# File 'ext/src/ruby_api/pooling_allocation_config.rs', line 72

pub fn set_max_tables_per_component(
    rb_self: Obj<Self>,
    max_tables: u32,
) -> Result<Obj<Self>, Error> {
    rb_self.borrow_mut()?.max_tables_per_component(max_tables);
    Ok(rb_self)
}

#total_memories=(total_memories) ⇒ Wasmtime::PoolingAllocationConfig

Parameters:

  • total_memories (Integer)

Returns:



41
42
43
44
45
# File 'ext/src/ruby_api/pooling_allocation_config.rs', line 41

pub fn set_total_memories(rb_self: Obj<Self>, total_memories: u32) -> Result<Obj<Self>, Error> {
    rb_self.borrow_mut()?.total_memories(total_memories);

    Ok(rb_self)
}

#total_tables=(total_tables) ⇒ Wasmtime::PoolingAllocationConfig

Parameters:

  • total_tables (Integer)

Returns:



51
52
53
54
# File 'ext/src/ruby_api/pooling_allocation_config.rs', line 51

pub fn set_total_tables(rb_self: Obj<Self>, total_tables: u32) -> Result<Obj<Self>, Error> {
    rb_self.borrow_mut()?.total_tables(total_tables);
    Ok(rb_self)
}