@nxtedition/rocksdb 10.0.17 → 10.0.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
Binary file
|
package/util.h
CHANGED
|
@@ -245,11 +245,9 @@ napi_status Convert(napi_env env, rocksdb::PinnableSlice* s, Encoding encoding,
|
|
|
245
245
|
if (!s || !s->IsPinned()) {
|
|
246
246
|
return napi_get_null(env, &result);
|
|
247
247
|
} else if (encoding == Encoding::Buffer) {
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
// Finalize<rocksdb::PinnableSlice>, ptr, &result);
|
|
252
|
-
return napi_create_buffer_copy(env, s->size(), s->data(), nullptr, &result);
|
|
248
|
+
auto ptr = new rocksdb::PinnableSlice(std::move(*s));
|
|
249
|
+
return napi_create_external_buffer(env, ptr->size(), const_cast<char*>(ptr->data()),
|
|
250
|
+
Finalize<rocksdb::PinnableSlice>, ptr, &result);
|
|
253
251
|
} else if (encoding == Encoding::String) {
|
|
254
252
|
return napi_create_string_utf8(env, s->data(), s->size(), &result);
|
|
255
253
|
} else {
|