Returns the byte length of this memory. WebAssembly memories are made up of a whole number of pages, so the byte size returned will always be a multiple of this memory's page size. Note that different Wasm memories may have different page sizes. You can get a memory's page size via the [`Memory::page_size`] method. By default the page size is 64KiB (aka `0x10000`, `2**16`, `1<<16`, or `65536`) b
(&self, store: impl AsContext)
| 504 | /// |
| 505 | /// Panics if this memory doesn't belong to `store`. |
| 506 | pub fn data_size(&self, store: impl AsContext) -> usize { |
| 507 | self.internal_data_size(store.as_context().0) |
| 508 | } |
| 509 | |
| 510 | pub(crate) fn internal_data_size(&self, store: &StoreOpaque) -> usize { |
| 511 | store[self.instance].memory(self.index).current_length() |