Grows this WebAssembly memory by `delta` pages. This will attempt to add `delta` more pages of memory on to the end of this `Memory` instance. If successful this may relocate the memory and cause [`Memory::data_ptr`] to return a new value. Additionally any unsafely constructed slices into this memory may no longer be valid. On success returns the number of pages this memory previously had before
(&self, mut store: impl AsContextMut, delta: u64)
| 635 | /// # } |
| 636 | /// ``` |
| 637 | pub fn grow(&self, mut store: impl AsContextMut, delta: u64) -> Result<u64> { |
| 638 | let store = store.as_context_mut().0; |
| 639 | let (mut limiter, store) = store.validate_sync_resource_limiter_and_store_opaque()?; |
| 640 | vm::assert_ready(self._grow(store, limiter.as_mut(), delta)) |
| 641 | } |
| 642 | |
| 643 | /// Async variant of [`Memory::grow`]. Required when using a |
| 644 | /// [`ResourceLimiterAsync`](`crate::ResourceLimiterAsync`). |