Skip to content

Commit 9da2720

Browse files
gahaasvictorgomes
authored andcommitted
Reverts #192 (#193)
* [wasi] Stop using V8 fast API * Revert "[wasi] Stop using V8 fast API" This reverts commit 0d5d171. * Revert "[v8] Stop using deprecated fields of v8::FastApiCallbackOptions (#192)" This reverts commit 286ed38.
1 parent 1e60e3d commit 9da2720

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/node_wasi.cc

+5-5
Original file line numberDiff line numberDiff line change
@@ -258,12 +258,12 @@ R WASI::WasiFunction<FT, F, R, Args...>::FastCallback(
258258
THROW_ERR_WASI_NOT_STARTED(isolate);
259259
return EinvalError<R>();
260260
}
261-
Local<ArrayBuffer> ab = wasi->memory_.Get(isolate)->Buffer();
262-
size_t mem_size = ab->ByteLength();
263-
char* mem_data = static_cast<char*>(ab->Data());
264-
CHECK_NOT_NULL(mem_data);
261+
uint8_t* memory = nullptr;
262+
CHECK(LIKELY(options.wasm_memory->getStorageIfAligned(&memory)));
265263

266-
return F(*wasi, {mem_data, mem_size}, args...);
264+
return F(*wasi,
265+
{reinterpret_cast<char*>(memory), options.wasm_memory->length()},
266+
args...);
267267
}
268268

269269
namespace {

0 commit comments

Comments
 (0)