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

Unified Diff: base/memory/discardable_memory.h

Issue 17106004: Add discardable memory emulation for non-android/mac platforms (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix MemoryAfterUnlock test Created 7 years, 2 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.h
diff --git a/base/memory/discardable_memory.h b/base/memory/discardable_memory.h
index c6a8d82da72363d3dc2cecbb01547eeb64c226eb..d8fd4f69309160536b9ef4fec4cb0bbfb599f5e3 100644
--- a/base/memory/discardable_memory.h
+++ b/base/memory/discardable_memory.h
@@ -38,6 +38,9 @@ enum LockDiscardableMemoryStatus {
// - Because of memory alignment, the amount of memory allocated can be
// larger than the requested memory size. It is not very efficient for
// small allocations.
+// - A discardable memory instance is not thread safe. It is the
+// responsibility of users of discardable memory to ensure there are no
+// races.
//
// References:
// - Linux: http://lwn.net/Articles/452035/
@@ -48,8 +51,9 @@ class BASE_EXPORT DiscardableMemory {
public:
virtual ~DiscardableMemory() {}
- // Returns whether the system supports discardable memory.
- static bool Supported();
+ // Check whether the system supports discardable memory natively. Returns
+ // false if the support is emulated.
+ static bool SupportedNatively();
static scoped_ptr<DiscardableMemory> CreateLockedMemory(size_t size);

Powered by Google App Engine
This is Rietveld 408576698