MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / create

Method create

crates/c-api/include/wasmtime/table.hh:48–56  ·  view source on GitHub ↗

* \brief Creates a new host-defined table. * * \param cx the store in which to create the table. * \param ty the type of the table to be created * \param init the initial value for all table slots. * * Returns an error if `init` has the wrong value for the `ty` specified. */

Source from the content-addressed store, hash-verified

46 * Returns an error if `init` has the wrong value for the `ty` specified.
47 */
48 static Result<Table> create(Store::Context cx, const TableType &ty,
49 const Val &init) {
50 wasmtime_table_t table;
51 auto *error = wasmtime_table_new(cx.ptr, ty.ptr.get(), &init.val, &table);
52 if (error != nullptr) {
53 return Error(error);
54 }
55 return Table(table);
56 }
57
58 /// Returns the type of this table.
59 TableType type(Store::Context cx) const {

Callers

nothing calls this directly

Calls 4

wasmtime_table_newFunction · 0.85
ErrorClass · 0.70
TableClass · 0.70
getMethod · 0.45

Tested by

no test coverage detected