diff --git a/java/rocksjni/options.cc b/java/rocksjni/options.cc index 4385085d0..c66620da2 100644 --- a/java/rocksjni/options.cc +++ b/java/rocksjni/options.cc @@ -1104,7 +1104,8 @@ std::vector rocksdb_compression_vector_helper( */ jbyteArray rocksdb_compression_list_helper(JNIEnv* env, std::vector compressionLevels) { - std::unique_ptr jbuf = std::make_unique(compressionLevels.size()); + std::unique_ptr jbuf = + std::unique_ptr(new jbyte[compressionLevels.size()]); for (std::vector::size_type i = 0; i != compressionLevels.size(); i++) { jbuf[i] = compressionLevels[i]; diff --git a/java/rocksjni/rocksjni.cc b/java/rocksjni/rocksjni.cc index 6c064fd6d..4c6817863 100644 --- a/java/rocksjni/rocksjni.cc +++ b/java/rocksjni/rocksjni.cc @@ -115,7 +115,8 @@ jlongArray rocksdb_open_helper(JNIEnv* env, jlong jopt_handle, // check if open operation was successful if (s.ok()) { jsize resultsLen = 1 + len_cols; //db handle + column family handles - std::unique_ptr results = std::make_unique(resultsLen); + std::unique_ptr results = + std::unique_ptr(new jlong[resultsLen]); results[0] = reinterpret_cast(db); for(int i = 1; i <= len_cols; i++) { results[i] = reinterpret_cast(handles[i - 1]); diff --git a/java/rocksjni/ttl.cc b/java/rocksjni/ttl.cc index 8dc7280f0..6b39252f1 100644 --- a/java/rocksjni/ttl.cc +++ b/java/rocksjni/ttl.cc @@ -96,7 +96,8 @@ jlongArray // check if open operation was successful if (s.ok()) { jsize resultsLen = 1 + len_cols; //db handle + column family handles - std::unique_ptr results = std::make_unique(resultsLen); + std::unique_ptr results = + std::unique_ptr(new jlong[resultsLen]); results[0] = reinterpret_cast(db); for(int i = 1; i <= len_cols; i++) { results[i] = reinterpret_cast(handles[i - 1]);