From 891bb7a5761070250186df656eee7451d5456b0b Mon Sep 17 00:00:00 2001 From: Lars Kuhtz Date: Sun, 1 Aug 2021 12:30:27 -0700 Subject: [PATCH] Support approximateSize() on db bigger than 4 GB (#175) By using napi_create_int64 instead of napi_create_int32. Ported from https://github.com/Level/leveldown/pull/777. --- binding.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/binding.cc b/binding.cc index 1899b3a9..67ac9a81 100644 --- a/binding.cc +++ b/binding.cc @@ -1077,7 +1077,7 @@ struct ApproximateSizeWorker final : public PriorityWorker { void HandleOKCallback () override { napi_value argv[2]; napi_get_null(env_, &argv[0]); - napi_create_uint32(env_, (uint32_t)size_, &argv[1]); + napi_create_int64(env_, (int64_t)size_, &argv[1]); napi_value callback; napi_get_reference_value(env_, callbackRef_, &callback); CallFunction(env_, callback, 2, argv);