Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(393)

Unified Diff: third_party/ashmem/ashmem-dev.c

Issue 52833002: Purge unpinned ashmem before parsing /proc/$pid/smaps. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Update documentation Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/ashmem/ashmem.h ('k') | tools/android/android_tools.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
+}
« no previous file with comments | « third_party/ashmem/ashmem.h ('k') | tools/android/android_tools.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698