| 2909 | } |
| 2910 | |
| 2911 | WASMEDGE_CAPI_EXPORT uint8_t * |
| 2912 | WasmEdge_MemoryInstanceGetPointer(WasmEdge_MemoryInstanceContext *Cxt, |
| 2913 | const uint64_t Offset, |
| 2914 | const uint64_t Length) noexcept { |
| 2915 | if (Cxt) { |
| 2916 | const auto S = fromMemCxt(Cxt)->getSpan<uint8_t>(Offset, Length); |
| 2917 | if (S.size() == Length) { |
| 2918 | return S.data(); |
| 2919 | } |
| 2920 | } |
| 2921 | return nullptr; |
| 2922 | } |
| 2923 | |
| 2924 | WASMEDGE_CAPI_EXPORT const uint8_t *WasmEdge_MemoryInstanceGetPointerConst( |
| 2925 | const WasmEdge_MemoryInstanceContext *Cxt, const uint64_t Offset, |