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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « third_party/ashmem/ashmem.h ('k') | tools/android/android_tools.gyp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2008 The Android Open Source Project 2 * Copyright (C) 2008 The Android Open Source Project
3 * 3 *
4 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License. 5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at 6 * You may obtain a copy of the License at
7 * 7 *
8 * http://www.apache.org/licenses/LICENSE-2.0 8 * http://www.apache.org/licenses/LICENSE-2.0
9 * 9 *
10 * Unless required by applicable law or agreed to in writing, software 10 * Unless required by applicable law or agreed to in writing, software
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 int ashmem_unpin_region(int fd, size_t offset, size_t len) 81 int ashmem_unpin_region(int fd, size_t offset, size_t len)
82 { 82 {
83 struct ashmem_pin pin = { offset, len }; 83 struct ashmem_pin pin = { offset, len };
84 return ioctl(fd, ASHMEM_UNPIN, &pin); 84 return ioctl(fd, ASHMEM_UNPIN, &pin);
85 } 85 }
86 86
87 int ashmem_get_size_region(int fd) 87 int ashmem_get_size_region(int fd)
88 { 88 {
89 return ioctl(fd, ASHMEM_GET_SIZE, NULL); 89 return ioctl(fd, ASHMEM_GET_SIZE, NULL);
90 } 90 }
91
92 int ashmem_purge_all(void)
93 {
94 const int fd = open(ASHMEM_DEVICE, O_RDWR);
95 if (fd < 0)
96 return fd;
97 const int ret = ioctl(fd, ASHMEM_PURGE_ALL_CACHES, 0);
98 close(fd);
99 return ret;
100 }
OLDNEW
« 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