| 508 | } |
| 509 | |
| 510 | Expect<uint64_t> Executor::proxyMemGrow(Runtime::StackManager &StackMgr, |
| 511 | const uint32_t MemIdx, |
| 512 | const uint64_t NewSize) noexcept { |
| 513 | auto *MemInst = getMemInstByIdx(StackMgr, MemIdx); |
| 514 | assuming(MemInst); |
| 515 | const auto AddrType = MemInst->getMemoryType().getLimit().getAddrType(); |
| 516 | const uint64_t CurrPageSize = MemInst->getPageSize(); |
| 517 | if (MemInst->growPage(NewSize)) { |
| 518 | return CurrPageSize; |
| 519 | } else { |
| 520 | switch (AddrType) { |
| 521 | case AddressType::I32: |
| 522 | return static_cast<uint32_t>(-1); |
| 523 | case AddressType::I64: |
| 524 | return static_cast<uint64_t>(-1); |
| 525 | default: |
| 526 | assumingUnreachable(); |
| 527 | } |
| 528 | } |
| 529 | } |
| 530 | |
| 531 | Expect<uint64_t> Executor::proxyMemSize(Runtime::StackManager &StackMgr, |
| 532 | const uint32_t MemIdx) noexcept { |
nothing calls this directly
no test coverage detected