Skip to content

Commit

Permalink
node::Buffer::New allows to map buffers up to 2GB (2GB - 64KB in my t…
Browse files Browse the repository at this point in the history
…est)
  • Loading branch information
borys committed Feb 15, 2019
1 parent 8b3fb45 commit 6b6c73c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/mmap-io.cc
Expand Up @@ -100,7 +100,8 @@ JS_FN(mmap_map) {
}

auto map_info = new MMap(data, size);
Nan::MaybeLocal<Object> buf = Nan::NewBuffer(data, size, do_mmap_cleanup, static_cast<void*>(map_info));
Nan::MaybeLocal<Object> buf = node::Buffer::New(
v8::Isolate::GetCurrent(), data, size, do_mmap_cleanup, static_cast<void*>(map_info));
if (buf.IsEmpty()) {
return Nan::ThrowError(std::string("couldn't allocate Node Buffer()").c_str());
} else {
Expand Down

0 comments on commit 6b6c73c

Please sign in to comment.