Shared memory region in NDK

后端 未结 3 762
北恋
北恋 2021-01-16 15:31

I want to have a shared memory block (an ashmem region) that\'s mapped and accessed from native code. I also want this block to be used by several applications.

3条回答
  •  难免孤独
    2021-01-16 16:16

    There is a method in helper library libnativehelper.so for this jniCreateFileDescriptor() https://android.googlesource.com/platform/libnativehelper/+/jb-dev/include/nativehelper/JNIHelp.h. It basically does the same thing as stated in previous answer but you might find this approach a bit cleaner.

提交回复
热议问题