summaryrefslogtreecommitdiffstats
path: root/base
diff options
context:
space:
mode:
authorviettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-02-15 17:39:15 +0000
committerviettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-02-15 17:39:15 +0000
commita164f4156567ca3eda7edd6e1cebfe856c0cd1c0 (patch)
treec24cd9c5deb837d84965a8b63546579a3d25b911 /base
parentfcc7a32ca3feb781af28e23ad9acb20a66008581 (diff)
downloadchromium_src-a164f4156567ca3eda7edd6e1cebfe856c0cd1c0.zip
chromium_src-a164f4156567ca3eda7edd6e1cebfe856c0cd1c0.tar.gz
chromium_src-a164f4156567ca3eda7edd6e1cebfe856c0cd1c0.tar.bz2
Rename base::ScopedPtrAlignedFree to AlignedFreeDeleter.
(The new name is consistent with base::FreeDeleter.) Also, update comments to refer to scoped_ptr rather than the deprecated scoped_ptr_malloc, and convert scoped_ptr_malloc<..., ScopedPtrAlignedFree> to scoped_Ptr<..., AlignedFreeDeleter>. R=brettw@chromium.org, dalecurtis@chromium.org, piman@chromium.org, brettw TBR=piman, tyoshino Review URL: https://codereview.chromium.org/167663002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@251586 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base')
-rw-r--r--base/memory/aligned_memory.h6
-rw-r--r--base/memory/aligned_memory_unittest.cc2
2 files changed, 4 insertions, 4 deletions
diff --git a/base/memory/aligned_memory.h b/base/memory/aligned_memory.h
index 6719599..edbe19c 100644
--- a/base/memory/aligned_memory.h
+++ b/base/memory/aligned_memory.h
@@ -101,9 +101,9 @@ inline void AlignedFree(void* ptr) {
#endif
}
-// Helper class for use with scoped_ptr_malloc.
-class BASE_EXPORT ScopedPtrAlignedFree {
- public:
+// Deleter for use with scoped_ptr. E.g., use as
+// scoped_ptr<Foo, base::AlignedFreeDeleter> foo;
+struct AlignedFreeDeleter {
inline void operator()(void* ptr) const {
AlignedFree(ptr);
}
diff --git a/base/memory/aligned_memory_unittest.cc b/base/memory/aligned_memory_unittest.cc
index 6942249..10ffeb0 100644
--- a/base/memory/aligned_memory_unittest.cc
+++ b/base/memory/aligned_memory_unittest.cc
@@ -86,7 +86,7 @@ TEST(AlignedMemoryTest, DynamicAllocation) {
}
TEST(AlignedMemoryTest, ScopedDynamicAllocation) {
- scoped_ptr_malloc<float, base::ScopedPtrAlignedFree> p(
+ scoped_ptr<float, base::AlignedFreeDeleter> p(
static_cast<float*>(base::AlignedAlloc(8, 8)));
EXPECT_TRUE(p.get());
EXPECT_ALIGNED(p.get(), 8);