Index: third_party/ashmem/ashmem-dev.c |
diff --git a/third_party/ashmem/ashmem-dev.c b/third_party/ashmem/ashmem-dev.c |
index 1cfdfe0761313d08cc61bf7faa8c3895c7130f2e..2303369d81678af9a3c351040419b9d2e6e39b79 100644 |
--- a/third_party/ashmem/ashmem-dev.c |
+++ b/third_party/ashmem/ashmem-dev.c |
@@ -88,3 +88,13 @@ int ashmem_get_size_region(int fd) |
{ |
return ioctl(fd, ASHMEM_GET_SIZE, NULL); |
} |
+ |
+int ashmem_purge_all(void) |
+{ |
+ const int fd = open(ASHMEM_DEVICE, O_RDWR); |
+ if (fd < 0) |
+ return fd; |
+ const int ret = ioctl(fd, ASHMEM_PURGE_ALL_CACHES, 0); |
+ close(fd); |
+ return ret; |
+} |