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

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: Address William's comments 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
« no previous file with comments | « no previous file | base/memory/discardable_memory_allocator_android.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..eea57fb3893a827c40063dcafb520650ed010d8b 100644
--- a/base/memory/discardable_memory_allocator_android.h
+++ b/base/memory/discardable_memory_allocator_android.h
@@ -44,16 +44,21 @@ class BASE_EXPORT_PRIVATE DiscardableMemoryAllocator {
// instance.
scoped_ptr<DiscardableMemory> Allocate(size_t size);
+ // Returns the size of the last ashmem region which was created. This is used
+ // for testing only.
+ size_t last_ashmem_region_size() const;
+
private:
class AshmemRegion;
class DiscardableAshmemChunk;
void DeleteAshmemRegion_Locked(AshmemRegion* region);
- base::ThreadChecker thread_checker_;
+ ThreadChecker thread_checker_;
const std::string name_;
const size_t ashmem_region_size_;
- base::Lock lock_;
+ mutable Lock lock_;
+ size_t last_ashmem_region_size_;
ScopedVector<AshmemRegion> ashmem_regions_;
DISALLOW_COPY_AND_ASSIGN(DiscardableMemoryAllocator);
« no previous file with comments | « no previous file | base/memory/discardable_memory_allocator_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698