Chromium Code Reviews| Index: tools/android/purge_ashmem/purge_ashmem.c |
| diff --git a/tools/android/purge_ashmem/purge_ashmem.c b/tools/android/purge_ashmem/purge_ashmem.c |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..fb9bf657cbd99e935d02abf6be1743e716f73da1 |
| --- /dev/null |
| +++ b/tools/android/purge_ashmem/purge_ashmem.c |
| @@ -0,0 +1,20 @@ |
| +// Copyright 2013 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#include <stdio.h> |
| +#include <stdlib.h> |
| +#include <unistd.h> |
| + |
| +#include "../../../third_party/ashmem/ashmem.h" |
|
bulach
2013/11/04 20:22:06
I think the common way is to -I../../.. so this be
Philippe
2013/11/05 09:22:13
Done.
|
| + |
| +int main(void) { |
| + const int pages_purged = ashmem_purge_all(); |
| + if (pages_purged < 0) { |
| + perror("ashmem_purge_all"); |
| + return EXIT_FAILURE; |
| + } |
| + printf("Purged %d pages (%d KBytes)\n", |
| + pages_purged, pages_purged * getpagesize() / 1024); |
| + return EXIT_SUCCESS; |
| +} |