Skip to content

Commit

Permalink
Review comments for Java LoggerFromOptions
Browse files Browse the repository at this point in the history
Use standard macro for returning C++ pointer as Java
JNIEXPORT and JNICALL not necessary in the implementation part of JNI methods, just the (autogenerated) declarations
  • Loading branch information
alanpaxton committed Oct 2, 2024
1 parent 022a944 commit f014680
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions java/rocksjni/logger_from_options.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@
* Method: newLoggerFromOptions
* Signature: (J)J
*/
JNIEXPORT jlong JNICALL
Java_org_rocksdb_util_LoggerFromOptions_createLoggerFromOptions(
jlong Java_org_rocksdb_util_LoggerFromOptions_createLoggerFromOptions(
JNIEnv* env, jclass, jstring jdb_name, jlong joptions_handle) {
auto* db_options =
reinterpret_cast<ROCKSDB_NAMESPACE::DBOptions*>(joptions_handle);
Expand All @@ -49,7 +48,7 @@ Java_org_rocksdb_util_LoggerFromOptions_createLoggerFromOptions(
return 0;
}

return reinterpret_cast<jlong>(
return GET_CPLUSPLUS_POINTER(
new std::shared_ptr<ROCKSDB_NAMESPACE::Logger>(std::move(logger)));
}

Expand Down

0 comments on commit f014680

Please sign in to comment.