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

Side by Side Diff: third_party/tcmalloc/chromium/src/base/stl_allocator.h

Issue 7033062: Replaced ptrdiff_t with std::ptrdiff_t in all files to enable build with gcc-4.6.0. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | third_party/tcmalloc/chromium/src/base/vdso_support.cc » ('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) 2006, Google Inc. 1 /* Copyright (c) 2006, Google Inc.
2 * All rights reserved. 2 * All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 // 52 //
53 // Usage example: 53 // Usage example:
54 // set<T, less<T>, STL_Allocator<T, MyAlloc> > my_set; 54 // set<T, less<T>, STL_Allocator<T, MyAlloc> > my_set;
55 // CAVEAT: Parts of the code below are probably specific 55 // CAVEAT: Parts of the code below are probably specific
56 // to the STL version(s) we are using. 56 // to the STL version(s) we are using.
57 // The code is simply lifted from what std::allocator<> provides. 57 // The code is simply lifted from what std::allocator<> provides.
58 template <typename T, class Alloc> 58 template <typename T, class Alloc>
59 class STL_Allocator { 59 class STL_Allocator {
60 public: 60 public:
61 typedef size_t size_type; 61 typedef size_t size_type;
62 typedef ptrdiff_t difference_type; 62 typedef std::ptrdiff_t difference_type;
63 typedef T* pointer; 63 typedef T* pointer;
64 typedef const T* const_pointer; 64 typedef const T* const_pointer;
65 typedef T& reference; 65 typedef T& reference;
66 typedef const T& const_reference; 66 typedef const T& const_reference;
67 typedef T value_type; 67 typedef T value_type;
68 68
69 template <class T1> struct rebind { 69 template <class T1> struct rebind {
70 typedef STL_Allocator<T1, Alloc> other; 70 typedef STL_Allocator<T1, Alloc> other;
71 }; 71 };
72 72
(...skipping 14 matching lines...) Expand all
87 size_type max_size() const { return size_t(-1) / sizeof(T); } 87 size_type max_size() const { return size_t(-1) / sizeof(T); }
88 88
89 void construct(pointer p, const T& val) { ::new(p) T(val); } 89 void construct(pointer p, const T& val) { ::new(p) T(val); }
90 void destroy(pointer p) { p->~T(); } 90 void destroy(pointer p) { p->~T(); }
91 91
92 // There's no state, so these allocators are always equal 92 // There's no state, so these allocators are always equal
93 bool operator==(const STL_Allocator&) const { return true; } 93 bool operator==(const STL_Allocator&) const { return true; }
94 }; 94 };
95 95
96 #endif // BASE_STL_ALLOCATOR_H_ 96 #endif // BASE_STL_ALLOCATOR_H_
OLDNEW
« no previous file with comments | « no previous file | third_party/tcmalloc/chromium/src/base/vdso_support.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698