(&self)
| 151 | |
| 152 | impl RunCommon { |
| 153 | pub fn store_limits(&self) -> StoreLimits { |
| 154 | let mut limits = StoreLimitsBuilder::new(); |
| 155 | if let Some(max) = self.common.wasm.max_memory_size { |
| 156 | limits = limits.memory_size(max); |
| 157 | } |
| 158 | if let Some(max) = self.common.wasm.max_table_elements { |
| 159 | limits = limits.table_elements(max); |
| 160 | } |
| 161 | if let Some(max) = self.common.wasm.max_instances { |
| 162 | limits = limits.instances(max); |
| 163 | } |
| 164 | if let Some(max) = self.common.wasm.max_tables { |
| 165 | limits = limits.tables(max); |
| 166 | } |
| 167 | if let Some(max) = self.common.wasm.max_memories { |
| 168 | limits = limits.memories(max); |
| 169 | } |
| 170 | if let Some(enable) = self.common.wasm.trap_on_grow_failure { |
| 171 | limits = limits.trap_on_grow_failure(enable); |
| 172 | } |
| 173 | |
| 174 | limits.build() |
| 175 | } |
| 176 | |
| 177 | pub fn ensure_allow_precompiled(&self) -> Result<()> { |
| 178 | if self.allow_precompiled { |
no test coverage detected