X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fceph%2Fsrc%2Fjava%2Fnative%2FJniConstants.h;fp=src%2Fceph%2Fsrc%2Fjava%2Fnative%2FJniConstants.h;h=0000000000000000000000000000000000000000;hb=7da45d65be36d36b880cc55c5036e96c24b53f00;hp=acee86709d38995197ab008dc00e9422e1f6770f;hpb=691462d09d0987b47e112d6ee8740375df3c51b2;p=stor4nfv.git diff --git a/src/ceph/src/java/native/JniConstants.h b/src/ceph/src/java/native/JniConstants.h deleted file mode 100644 index acee867..0000000 --- a/src/ceph/src/java/native/JniConstants.h +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (C) 2010 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef JNI_CONSTANTS_H_included -#define JNI_CONSTANTS_H_included - -#include - -/** - * A cache to avoid calling FindClass at runtime. - * - * Class lookup is relatively expensive (2.5us on passion-eng at the time of writing), so we do - * all such lookups eagerly at VM startup. This means that code that never uses, say, - * java.util.zip.Deflater still has to pay for the lookup, but it means that on a device the cost - * is definitely paid during boot and amortized. A central cache also removes the temptation to - * dynamically call FindClass rather than add a small cache to each file that needs one. Another - * cost is that each class cached here requires a global reference, though in practice we save - * enough by not having a global reference for each file that uses a class such as java.lang.String - * which is used in several files. - * - * FindClass is still called in a couple of situations: when throwing exceptions, and in some of - * the serialization code. The former is clearly not a performance case, and we're currently - * assuming that neither is the latter. - * - * TODO: similar arguments hold for field and method IDs; we should cache them centrally too. - */ -struct JniConstants { - static void init(JNIEnv* env); - - static jclass inet6AddressClass; - static jclass inetAddressClass; - static jclass inetSocketAddressClass; - static jclass stringClass; -}; - -#define NATIVE_METHOD(className, functionName, signature) \ - { #functionName, signature, reinterpret_cast(className ## _ ## functionName) } - -#endif // JNI_CONSTANTS_H_included