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

Side by Side Diff: Source/wtf/DefaultAllocator.h

Issue 720163002: Oilpan: Vector::reserveCapacity shouldn't reallocate backing storage always (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 1 month 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 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. 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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 void* result = backingAllocate(size); 81 void* result = backingAllocate(size);
82 memset(result, 0, size); 82 memset(result, 0, size);
83 return reinterpret_cast<Return>(result); 83 return reinterpret_cast<Return>(result);
84 } 84 }
85 template <typename Return, typename Metadata> 85 template <typename Return, typename Metadata>
86 static Return malloc(size_t size) 86 static Return malloc(size_t size)
87 { 87 {
88 return reinterpret_cast<Return>(fastMalloc(size)); 88 return reinterpret_cast<Return>(fastMalloc(size));
89 } 89 }
90 WTF_EXPORT static void backingFree(void* address); 90 WTF_EXPORT static void backingFree(void* address);
91 WTF_EXPORT static bool backingExpand(void*, size_t)
tkent 2014/11/14 03:54:24 Can we make this |inilne|?
haraken 2014/11/14 04:32:45 Done.
92 {
93 return false;
94 }
91 static void free(void* address) 95 static void free(void* address)
92 { 96 {
93 fastFree(address); 97 fastFree(address);
94 } 98 }
95 template<typename T> 99 template<typename T>
96 static void* newArray(size_t bytes) 100 static void* newArray(size_t bytes)
97 { 101 {
98 return malloc<void*, void>(bytes); 102 return malloc<void*, void>(bytes);
99 } 103 }
100 static void 104 static void
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 { \ 187 { \
184 ASSERT(location); \ 188 ASSERT(location); \
185 return location; \ 189 return location; \
186 } \ 190 } \
187 private: \ 191 private: \
188 typedef int __thisIsHereToForceASemicolonAfterThisMacro 192 typedef int __thisIsHereToForceASemicolonAfterThisMacro
189 193
190 using WTF::DefaultAllocator; 194 using WTF::DefaultAllocator;
191 195
192 #endif // WTF_DefaultAllocator_h 196 #endif // WTF_DefaultAllocator_h
OLDNEW
« no previous file with comments | « Source/platform/heap/Heap.cpp ('k') | Source/wtf/Deque.h » ('j') | Source/wtf/Vector.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698