| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 COURGETTE_MEMORY_ALLOCATOR_H_ | 5 #ifndef COURGETTE_MEMORY_ALLOCATOR_H_ |
| 6 #define COURGETTE_MEMORY_ALLOCATOR_H_ | 6 #define COURGETTE_MEMORY_ALLOCATOR_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 | 174 |
| 175 template<class OtherT> | 175 template<class OtherT> |
| 176 struct rebind { | 176 struct rebind { |
| 177 // convert an MemoryAllocator<T> to a MemoryAllocator<OtherT> | 177 // convert an MemoryAllocator<T> to a MemoryAllocator<OtherT> |
| 178 typedef MemoryAllocator<OtherT> other; | 178 typedef MemoryAllocator<OtherT> other; |
| 179 }; | 179 }; |
| 180 | 180 |
| 181 MemoryAllocator() _THROW0() { | 181 MemoryAllocator() _THROW0() { |
| 182 } | 182 } |
| 183 | 183 |
| 184 explicit MemoryAllocator(const MemoryAllocator<T>& other) _THROW0() { | 184 // We can't use an explicit constructor here, as dictated by our style guide. |
| 185 // The implementation of basic_string in Visual Studio 2010 prevents this. |
| 186 MemoryAllocator(const MemoryAllocator<T>& other) _THROW0() { |
| 185 } | 187 } |
| 186 | 188 |
| 187 template<class OtherT> | 189 template<class OtherT> |
| 188 explicit MemoryAllocator(const MemoryAllocator<OtherT>& other) _THROW0() { | 190 explicit MemoryAllocator(const MemoryAllocator<OtherT>& other) _THROW0() { |
| 189 } | 191 } |
| 190 | 192 |
| 191 ~MemoryAllocator() { | 193 ~MemoryAllocator() { |
| 192 } | 194 } |
| 193 | 195 |
| 194 void deallocate(pointer ptr, size_type size) { | 196 void deallocate(pointer ptr, size_type size) { |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 256 template<class T> | 258 template<class T> |
| 257 class MemoryAllocator : public std::allocator<T> { | 259 class MemoryAllocator : public std::allocator<T> { |
| 258 public: | 260 public: |
| 259 }; | 261 }; |
| 260 | 262 |
| 261 #endif // OS_WIN | 263 #endif // OS_WIN |
| 262 | 264 |
| 263 } // namespace courgette | 265 } // namespace courgette |
| 264 | 266 |
| 265 #endif // COURGETTE_MEMORY_ALLOCATOR_H_ | 267 #endif // COURGETTE_MEMORY_ALLOCATOR_H_ |
| OLD | NEW |