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

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

Issue 9311003: Update the tcmalloc chromium branch to r144 (gperftools 2.0), and merge chromium-specific changes. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Rebasec Created 8 years, 9 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
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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 80
81 pointer allocate(size_type n, const void* = 0) { 81 pointer allocate(size_type n, const void* = 0) {
82 RAW_DCHECK((n * sizeof(T)) / sizeof(T) == n, "n is too big to allocate"); 82 RAW_DCHECK((n * sizeof(T)) / sizeof(T) == n, "n is too big to allocate");
83 return static_cast<T*>(Alloc::Allocate(n * sizeof(T))); 83 return static_cast<T*>(Alloc::Allocate(n * sizeof(T)));
84 } 84 }
85 void deallocate(pointer p, size_type n) { Alloc::Free(p, n * sizeof(T)); } 85 void deallocate(pointer p, size_type n) { Alloc::Free(p, n * sizeof(T)); }
86 86
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 construct(pointer p) { ::new(p) T(); }
90 void destroy(pointer p) { p->~T(); } 91 void destroy(pointer p) { p->~T(); }
91 92
92 // There's no state, so these allocators are always equal 93 // There's no state, so these allocators are always equal
93 bool operator==(const STL_Allocator&) const { return true; } 94 bool operator==(const STL_Allocator&) const { return true; }
94 }; 95 };
95 96
96 #endif // BASE_STL_ALLOCATOR_H_ 97 #endif // BASE_STL_ALLOCATOR_H_
OLDNEW
« no previous file with comments | « third_party/tcmalloc/chromium/src/base/spinlock_win32-inl.h ('k') | third_party/tcmalloc/chromium/src/base/sysinfo.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698