色偷偷精品伊人,欧洲久久精品,欧美综合婷婷骚逼,国产AV主播,国产最新探花在线,九色在线视频一区,伊人大交九 欧美,1769亚洲,黄色成人av

240 發(fā)簡信
IP屬地:四川
  • 120
    Android JNI學習(二)——實戰(zhàn)JNI之“hello world”

    本系列文章如下: Android JNI(一)——NDK與JNI基礎Android JNI學習(二)——實戰(zhàn)JNI之“hello world”Android JNI學習(三)...

  • native函數(shù)沒有指針數(shù)組哦,我看了一下android Q里邊的實現(xiàn),在注冊native函數(shù)的時候,通過反射獲取到java方法地址后,直接將native 函數(shù)的地址,寫入到 對應java 方法地址開始往后的4個字節(jié)或8個字節(jié)的內(nèi)存空間里邊。
    具體實現(xiàn)在: android/art/runtime/art_method.h
    template<typename T>
    ALWAYS_INLINE void SetNativePointer(MemberOffset offset, T new_value, PointerSize pointer_size) {
    static_assert(std::is_pointer<T>::value, "T must be a pointer type");
    const auto addr = reinterpret_cast<uintptr_t>(this) + offset.Uint32Value();
    ///這邊將native函數(shù)地址進行寫入哦
    if (pointer_size == PointerSize::k32) {
    uintptr_t ptr = reinterpret_cast<uintptr_t>(new_value);
    *reinterpret_cast<uint32_t*>(addr) = dchecked_integral_cast<uint32_t>(ptr);
    } else {
    *reinterpret_cast<uint64_t*>(addr) = reinterpret_cast<uintptr_t>(new_value);
    }
    }

    大致調(diào)用棧為:
    SetNativePointer()
    SetDataPtrSize()
    SetEntryPointFromJniPtrSize()
    SetEntryPointFromJni()
    RegisterNative()
    RegisterNatives()
    jniRegisterNativeMethods()
    registerNativeMethods()
    RegisterMethodsOrDie()

城口县| 克什克腾旗| 遂平县| 花垣县| 延长县| 怀柔区| 北票市| 土默特左旗| 泊头市| 阜新| 西林县| 景德镇市| 磴口县| 正蓝旗| 潼南县| 周宁县| 剑河县| 浪卡子县| 秦安县| 嘉祥县| 萝北县| 香河县| 明星| 涞源县| 宿州市| 微山县| 酉阳| 鄯善县| 慈利县| 安泽县| 武汉市| 衡南县| 新和县| 贡山| 赣榆县| 万载县| 抚松县| 拉孜县| 政和县| 阿勒泰市| 北流市|