Convert munmap operation to JNI
This commit is contained in:
1 parent
f5bd097584
commit
6efe8922b3
2 files changed
+12
-9
No files matched your search
@@ -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);
|
||||
}
|
||||
Reference in new issue
Block a user