This commit is contained in:
Pat Hickey
2021-10-22 11:44:54 -07:00
parent bcbd74678a
commit 996289725d
2 changed files with 20 additions and 0 deletions

View File

@@ -406,6 +406,12 @@ impl Table {
/// Returns an error if `init` does not match the element type of the table,
/// or if `init` does not belong to the `store` provided.
///
/// # Panics
///
/// This function will panic when used with a [`Store`] which has a
/// [`ResourceLimiterAsync`] (see also: [`Store::limiter_async`]). When
/// using an async resource limiter, use [`Table::new_async`] instead.
///
/// # Examples
///
/// ```
@@ -570,6 +576,10 @@ impl Table {
/// # Panics
///
/// Panics if `store` does not own this table.
///
/// This function will panic when used with a [`Store`] which has a
/// [`ResourceLimiterAsync`] (see also: [`Store::limiter_async`]). When
/// using an async resource limiter, use [`Table::grow_async`] instead.
pub fn grow(&self, mut store: impl AsContextMut, delta: u32, init: Val) -> Result<u32> {
let store = store.as_context_mut().0;
let ty = self.ty(&store).element().clone();

View File

@@ -202,6 +202,12 @@ impl Memory {
/// The `store` argument will be the owner of the returned [`Memory`]. All
/// WebAssembly memory is initialized to zero.
///
/// # Panics
///
/// This function will panic if the [`Store`] has a
/// [`ResourceLimiterAsync`] (see also: [`Store::limiter_async`]). When
/// using an async resource limiter, use [`Memory::new_async`] instead.
///
/// # Examples
///
/// ```
@@ -459,6 +465,10 @@ impl Memory {
///
/// Panics if this memory doesn't belong to `store`.
///
/// This function will panic if the [`Store`] has a
/// [`ResourceLimiterAsync`] (see also: [`Store::limiter_async`]). When
/// using an async resource limiter, use [`Memory::grow_async`] instead.
///
/// # Examples
///
/// ```