wasmtime_store_limiter function

  1. @Native<Void Function(Pointer<wasmtime_store_t>, Int64, Int64, Int64, Int64, Int64)>(ffi.Pointer<wasmtime_store_t>, ffi.Int64, ffi.Int64, ffi.Int64, ffi.Int64, ffi.Int64)>()
void wasmtime_store_limiter(
  1. Pointer<wasmtime_store_t> store,
  2. int memory_size,
  3. int table_elements,
  4. int instances,
  5. int tables,
  6. int memories,
)

\brief Provides limits for a store. Used by hosts to limit resource consumption of instances. Use negative value to keep the default value for the limit.

\param store store where the limits should be set. \param memory_size the maximum number of bytes a linear memory can grow to. Growing a linear memory beyond this limit will fail. By default, linear memory will not be limited. \param table_elements the maximum number of elements in a table. Growing a table beyond this limit will fail. By default, table elements will not be limited. \param instances the maximum number of instances that can be created for a Store. Module instantiation will fail if this limit is exceeded. This value defaults to 10,000. \param tables the maximum number of tables that can be created for a Store. Module instantiation will fail if this limit is exceeded. This value defaults to 10,000. \param memories the maximum number of linear memories that can be created for a Store. Instantiation will fail with an error if this limit is exceeded. This value defaults to 10,000.

Use any negative value for the parameters that should be kept on the default values.

Note that the limits are only used to limit the creation/growth of resources in the future, this does not retroactively attempt to apply limits to the store.

Implementation

@ffi.Native<
  ffi.Void Function(
    ffi.Pointer<wasmtime_store_t>,
    ffi.Int64,
    ffi.Int64,
    ffi.Int64,
    ffi.Int64,
    ffi.Int64,
  )
>()
external void wasmtime_store_limiter(
  ffi.Pointer<wasmtime_store_t> store,
  int memory_size,
  int table_elements,
  int instances,
  int tables,
  int memories,
);