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

Side by Side Diff: third_party/WebKit/Source/wtf/Partitions.h

Issue 1409113010: Oilpan: Remove Partitions::fastStrDup (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
« no previous file with comments | « third_party/WebKit/Source/core/xml/XSLTProcessorLibxslt.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 static void* fastZeroedMalloc(size_t n) 110 static void* fastZeroedMalloc(size_t n)
111 { 111 {
112 void* result = fastMalloc(n); 112 void* result = fastMalloc(n);
113 memset(result, 0, n); 113 memset(result, 0, n);
114 return result; 114 return result;
115 } 115 }
116 static void* fastRealloc(void* p, size_t n) 116 static void* fastRealloc(void* p, size_t n)
117 { 117 {
118 return partitionReallocGeneric(Partitions::fastMallocPartition(), p, n); 118 return partitionReallocGeneric(Partitions::fastMallocPartition(), p, n);
119 } 119 }
120 static char* fastStrDup(const char* src)
121 {
122 size_t len = strlen(src) + 1;
123 char* dup = static_cast<char*>(fastMalloc(len));
124 memcpy(dup, src, len);
125 return dup;
126 }
127 static void fastFree(void* p) 120 static void fastFree(void* p)
128 { 121 {
129 partitionFreeGeneric(Partitions::fastMallocPartition(), p); 122 partitionFreeGeneric(Partitions::fastMallocPartition(), p);
130 } 123 }
131 124
132 static void handleOutOfMemory(); 125 static void handleOutOfMemory();
133 126
134 private: 127 private:
135 static int s_initializationLock; 128 static int s_initializationLock;
136 static bool s_initialized; 129 static bool s_initialized;
(...skipping 15 matching lines...) Expand all
152 static PartitionAllocatorGeneric m_fastMallocAllocator; 145 static PartitionAllocatorGeneric m_fastMallocAllocator;
153 static PartitionAllocatorGeneric m_bufferAllocator; 146 static PartitionAllocatorGeneric m_bufferAllocator;
154 static SizeSpecificPartitionAllocator<3328> m_nodeAllocator; 147 static SizeSpecificPartitionAllocator<3328> m_nodeAllocator;
155 static SizeSpecificPartitionAllocator<1024> m_layoutAllocator; 148 static SizeSpecificPartitionAllocator<1024> m_layoutAllocator;
156 static HistogramEnumerationFunction m_histogramEnumeration; 149 static HistogramEnumerationFunction m_histogramEnumeration;
157 }; 150 };
158 151
159 } // namespace WTF 152 } // namespace WTF
160 153
161 #endif // Partitions_h 154 #endif // Partitions_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/xml/XSLTProcessorLibxslt.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698