]> git.proxmox.com Git - ceph.git/blob - ceph/src/rocksdb/java/rocksjni/rocks_callback_object.cc
update sources to ceph Nautilus 14.2.1
[ceph.git] / ceph / src / rocksdb / java / rocksjni / rocks_callback_object.cc
1 // Copyright (c) 2011-present, Facebook, Inc. All rights reserved.
2 // This source code is licensed under both the GPLv2 (found in the
3 // COPYING file in the root directory) and Apache 2.0 License
4 // (found in the LICENSE.Apache file in the root directory).
5 //
6 // This file implements the "bridge" between Java and C++ for
7 // JNI Callbacks from C++ to sub-classes or org.rocksdb.RocksCallbackObject
8
9 #include <jni.h>
10
11 #include "include/org_rocksdb_RocksCallbackObject.h"
12 #include "jnicallback.h"
13
14 /*
15 * Class: org_rocksdb_RocksCallbackObject
16 * Method: disposeInternal
17 * Signature: (J)V
18 */
19 void Java_org_rocksdb_RocksCallbackObject_disposeInternal(JNIEnv* /*env*/,
20 jobject /*jobj*/,
21 jlong handle) {
22 // TODO(AR) is deleting from the super class JniCallback OK, or must we delete
23 // the subclass? Example hierarchies:
24 // 1) Comparator -> BaseComparatorJniCallback + JniCallback ->
25 // DirectComparatorJniCallback 2) Comparator -> BaseComparatorJniCallback +
26 // JniCallback -> ComparatorJniCallback
27 // I think this is okay, as Comparator and JniCallback both have virtual
28 // destructors...
29 delete reinterpret_cast<rocksdb::JniCallback*>(handle);
30 // @lint-ignore TXT4 T25377293 Grandfathered in
31 }