MCPcopy Create free account
hub / github.com/WasmEdge/WasmEdge / WasmEdge_MemoryInstanceGetPointer

Function WasmEdge_MemoryInstanceGetPointer

lib/api/wasmedge.cpp:2911–2922  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2909}
2910
2911WASMEDGE_CAPI_EXPORT uint8_t *
2912WasmEdge_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
2924WASMEDGE_CAPI_EXPORT const uint8_t *WasmEdge_MemoryInstanceGetPointerConst(
2925 const WasmEdge_MemoryInstanceContext *Cxt, const uint64_t Offset,

Callers 1

TESTFunction · 0.85

Calls 2

sizeMethod · 0.45
dataMethod · 0.45

Tested by 1

TESTFunction · 0.68