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

Side by Side Diff: trunk/src/base/memory/discardable_memory.h

Issue 100103003: Revert 239763 "Add DiscardableMemoryAllocator to minimize use of..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 years 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 | « trunk/src/base/base.gypi ('k') | trunk/src/base/memory/discardable_memory_allocator_android.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef BASE_MEMORY_DISCARDABLE_MEMORY_H_ 5 #ifndef BASE_MEMORY_DISCARDABLE_MEMORY_H_
6 #define BASE_MEMORY_DISCARDABLE_MEMORY_H_ 6 #define BASE_MEMORY_DISCARDABLE_MEMORY_H_
7 7
8 #include "base/base_export.h" 8 #include "base/base_export.h"
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 29 matching lines...) Expand all
40 // small allocations. 40 // small allocations.
41 // - A discardable memory instance is not thread safe. It is the 41 // - A discardable memory instance is not thread safe. It is the
42 // responsibility of users of discardable memory to ensure there are no 42 // responsibility of users of discardable memory to ensure there are no
43 // races. 43 // races.
44 // 44 //
45 // References: 45 // References:
46 // - Linux: http://lwn.net/Articles/452035/ 46 // - Linux: http://lwn.net/Articles/452035/
47 // - Mac: http://trac.webkit.org/browser/trunk/Source/WebCore/platform/mac/Pur geableBufferMac.cpp 47 // - Mac: http://trac.webkit.org/browser/trunk/Source/WebCore/platform/mac/Pur geableBufferMac.cpp
48 // the comment starting with "vm_object_purgable_control" at 48 // the comment starting with "vm_object_purgable_control" at
49 // http://www.opensource.apple.com/source/xnu/xnu-792.13.8/osfmk/vm/v m_object.c 49 // http://www.opensource.apple.com/source/xnu/xnu-792.13.8/osfmk/vm/v m_object.c
50 //
51 // Thread-safety: DiscardableMemory instances are not thread-safe.
52 class BASE_EXPORT DiscardableMemory { 50 class BASE_EXPORT DiscardableMemory {
53 public: 51 public:
54 virtual ~DiscardableMemory() {} 52 virtual ~DiscardableMemory() {}
55 53
56 // Check whether the system supports discardable memory natively. Returns 54 // Check whether the system supports discardable memory natively. Returns
57 // false if the support is emulated. 55 // false if the support is emulated.
58 static bool SupportedNatively(); 56 static bool SupportedNatively();
59 57
60 static scoped_ptr<DiscardableMemory> CreateLockedMemory(size_t size); 58 static scoped_ptr<DiscardableMemory> CreateLockedMemory(size_t size);
61 59
(...skipping 20 matching lines...) Expand all
82 static bool PurgeForTestingSupported(); 80 static bool PurgeForTestingSupported();
83 81
84 // Purge all discardable memory in the system. This call has global effects 82 // Purge all discardable memory in the system. This call has global effects
85 // across all running processes, so it should only be used for testing! 83 // across all running processes, so it should only be used for testing!
86 static void PurgeForTesting(); 84 static void PurgeForTesting();
87 }; 85 };
88 86
89 } // namespace base 87 } // namespace base
90 88
91 #endif // BASE_MEMORY_DISCARDABLE_MEMORY_H_ 89 #endif // BASE_MEMORY_DISCARDABLE_MEMORY_H_
OLDNEW
« no previous file with comments | « trunk/src/base/base.gypi ('k') | trunk/src/base/memory/discardable_memory_allocator_android.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698