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

Unified Diff: base/memory/discardable_memory_allocator_android.h

Issue 136723005: Align ashmem region sizes to page size after ashmem creation failed. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add unit test Created 6 years, 11 months 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
Index: base/memory/discardable_memory_allocator_android.h
diff --git a/base/memory/discardable_memory_allocator_android.h b/base/memory/discardable_memory_allocator_android.h
index 7ced405601ddea36d1800945174c929cd0475438..e99eb968d45ce6b406acc7fb8f99b14b91470595 100644
--- a/base/memory/discardable_memory_allocator_android.h
+++ b/base/memory/discardable_memory_allocator_android.h
@@ -44,6 +44,9 @@ class BASE_EXPORT_PRIVATE DiscardableMemoryAllocator {
// instance.
scoped_ptr<DiscardableMemory> Allocate(size_t size);
+ // Returns the size that is used to create ashmem regions.
+ size_t ashmem_region_size();
willchan no longer on Chromium 2014/01/15 00:37:49 Should be const, and then you'd need to made the L
Philippe 2014/01/15 09:18:12 Yeah, I thought it would have been slightly unfort
willchan no longer on Chromium 2014/01/16 01:52:37 If there is any context on this "infinite" case th
Philippe 2014/01/16 09:24:21 I'm not aware of bugs/docs for this new infinite c
+
private:
class AshmemRegion;
class DiscardableAshmemChunk;
@@ -52,8 +55,8 @@ class BASE_EXPORT_PRIVATE DiscardableMemoryAllocator {
base::ThreadChecker thread_checker_;
const std::string name_;
- const size_t ashmem_region_size_;
base::Lock lock_;
willchan no longer on Chromium 2014/01/15 00:37:49 Shouldn't need base:: here.
Philippe 2014/01/15 09:18:12 Done.
+ size_t ashmem_region_size_;
ScopedVector<AshmemRegion> ashmem_regions_;
DISALLOW_COPY_AND_ASSIGN(DiscardableMemoryAllocator);

Powered by Google App Engine
This is Rietveld 408576698