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

Method grow

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

Grow this table. \param cx the store that owns this table. \param delta the number of new elements to be added to this table. \param init the initial value of all new elements in this table. Returns an error if `init` has the wrong type for this table. Otherwise returns the previous size of the table before growth.

Source from the content-addressed store, hash-verified

97 /// Returns an error if `init` has the wrong type for this table. Otherwise
98 /// returns the previous size of the table before growth.
99 Result<uint64_t> grow(Store::Context cx, uint64_t delta,
100 const Val &init) const {
101 uint64_t prev = 0;
102 auto *error = wasmtime_table_grow(cx.ptr, &table, delta, &init.val, &prev);
103 if (error != nullptr) {
104 return Error(error);
105 }
106 return prev;
107 }
108
109 /// Returns the raw underlying C API table this is using.
110 const wasmtime_table_t &capi() const { return table; }

Callers 8

wasm_memory_growFunction · 0.45
wasmtime_memory_growFunction · 0.45
wasm_table_growFunction · 0.45
wasmtime_table_growFunction · 0.45
TESTFunction · 0.45
TESTFunction · 0.45
TESTFunction · 0.45

Calls 2

wasmtime_table_growFunction · 0.85
ErrorClass · 0.70

Tested by 3

TESTFunction · 0.36
TESTFunction · 0.36
TESTFunction · 0.36