Convert munmap operation to JNI

This commit is contained in:
tarsin committed 2023-02-02 20:15:05 +08:00
1 parent f5bd097584
commit 6efe8922b3
2 files changed
+12 -9

No files matched your search

-7
View File
@@ -23,10 +23,3 @@ Java_com_hippo_Native_getFd(JNIEnv *env, jclass clazz, jobject fileDescriptor) {
return fd;
}
JNIEXPORT void JNICALL
Java_com_hippo_Native_unmapDirectByteBuffer(JNIEnv *env, jclass clazz, jobject buffer) {
void *addr = (*env)->GetDirectBufferAddress(env, buffer);
size_t size = (*env)->GetDirectBufferCapacity(env, buffer);
if (munmap(addr, size)) LOGE("munmap addr:%p, size%zu failed!", addr, size);
}