Put bmalloc headers in the right place
[WebKit-https.git] / Source / bmalloc / ChangeLog
1 2014-04-09  Geoffrey Garen  <ggaren@apple.com>
2
3         Put bmalloc headers in the right place
4         https://bugs.webkit.org/show_bug.cgi?id=131464
5
6         Reviewed by Mark Rowe.
7
8         * Configurations/bmalloc.xcconfig: Set PRIVATE_HEADERS_FOLDER_PATH to
9         specify that we don't just want to dump all of our generically-named
10         headers into /usr/local/include.
11
12 2014-04-08  Geoffrey Garen  <ggaren@apple.com>
13
14         Made bmalloc more #include friendly
15         https://bugs.webkit.org/show_bug.cgi?id=131386
16
17         Reviewed by Andreas Kling.
18
19         Marked a bunch of headers private so they can be used from client code
20         that #includes bmalloc.h.
21
22         Renamed ASSERT macros to BASSERT. This matches their header, which already
23         had to be renamed, and fixes conflicts with WTF's ASSERT macros.
24
25         * bmalloc.xcodeproj/project.pbxproj:
26         * bmalloc/Allocator.cpp:
27         (bmalloc::Allocator::allocateSlowCase):
28         * bmalloc/AsyncTask.h:
29         (bmalloc::Function>::runSlowCase):
30         * bmalloc/BAssert.h:
31         * bmalloc/BoundaryTag.h:
32         (bmalloc::BoundaryTag::setSize):
33         * bmalloc/BoundaryTagInlines.h:
34         (bmalloc::validate):
35         (bmalloc::BoundaryTag::init):
36         (bmalloc::BoundaryTag::deallocate):
37         (bmalloc::BoundaryTag::splitLarge):
38         (bmalloc::BoundaryTag::allocate):
39         * bmalloc/Chunk.h:
40         * bmalloc/Deallocator.cpp:
41         (bmalloc::Deallocator::processObjectLog):
42         (bmalloc::Deallocator::deallocateSlowCase):
43         * bmalloc/Deallocator.h:
44         (bmalloc::Deallocator::deallocateFastCase):
45         * bmalloc/FixedVector.h:
46         (bmalloc::Capacity>::operator):
47         (bmalloc::Capacity>::push):
48         (bmalloc::Capacity>::pop):
49         (bmalloc::Capacity>::shrink):
50         * bmalloc/Heap.cpp:
51         (bmalloc::Heap::allocateLarge):
52         * bmalloc/LargeChunk.h:
53         (bmalloc::LargeChunk::get):
54         (bmalloc::LargeChunk::endTag):
55         * bmalloc/Line.h:
56         (bmalloc::Line<Traits>::concurrentRef):
57         (bmalloc::Line<Traits>::deref):
58         * bmalloc/MediumAllocator.h:
59         (bmalloc::MediumAllocator::allocate):
60         * bmalloc/ObjectType.h:
61         (bmalloc::isSmall):
62         * bmalloc/Page.h:
63         (bmalloc::Page<Traits>::ref):
64         (bmalloc::Page<Traits>::deref):
65         * bmalloc/PerThread.h:
66         (bmalloc::PerThread<T>::getSlowCase):
67         * bmalloc/SegregatedFreeList.cpp:
68         (bmalloc::SegregatedFreeList::SegregatedFreeList):
69         (bmalloc::SegregatedFreeList::insert):
70         * bmalloc/SmallAllocator.h:
71         (bmalloc::SmallAllocator::allocate):
72         (bmalloc::SmallAllocator::refill):
73         * bmalloc/Syscall.h:
74         * bmalloc/VMAllocate.h:
75         (bmalloc::vmValidate):
76         (bmalloc::vmAllocate):
77         (bmalloc::vmDeallocatePhysicalPagesSloppy):
78         * bmalloc/Vector.h:
79         (bmalloc::Vector<T>::operator):
80         (bmalloc::Vector<T>::pop):
81         (bmalloc::Vector<T>::shrink):
82         * bmalloc/XLargeChunk.h:
83         (bmalloc::XLargeChunk::range):
84         (bmalloc::XLargeChunk::size):
85
86 2014-04-08  Geoffrey Garen  <ggaren@apple.com>
87
88         Removed an unused file.
89
90         Unreviewed.
91
92         * bmalloc/AsyncTask.cpp: Removed.
93
94 2014-04-07  Geoffrey Garen  <ggaren@apple.com>
95
96         Build bmalloc on Mac
97         https://bugs.webkit.org/show_bug.cgi?id=131333
98
99         Reviewed by Mark Rowe.
100
101         * Makefile: Added. For make clients.
102
103         These files are required for building any project in WebKit. I copied
104         them from WTF:
105         * Configurations: Added.
106         * Configurations/Base.xcconfig: Added.
107         * Configurations/DebugRelease.xcconfig: Added.
108         * Configurations/bmalloc.xcconfig: Added.
109         * Configurations/iOS.xcconfig: Added.
110         * Configurations/mbmalloc.xcconfig: Added.
111
112         * bmalloc.xcodeproj/project.pbxproj: I removed per-project-file stuff
113         from here because everything is in .xcconfig files now.
114
115         I had to fix a bunch of minor warnings, since they're enabled in our
116         .xcconfig files:
117
118         * bmalloc/AsyncTask.h:
119         (bmalloc::Function>::AsyncTask):
120         * bmalloc/BAssert.h:
121         * bmalloc/BoundaryTagInlines.h:
122         (bmalloc::validate):
123         * bmalloc/Heap.cpp:
124         (bmalloc::Heap::Heap):
125         (bmalloc::Heap::allocateLarge):
126         (bmalloc::Heap::deallocateLarge):
127         * bmalloc/Mutex.h:
128         (bmalloc::Mutex::Mutex): Deleted.
129         * bmalloc/VMAllocate.h:
130         (bmalloc::vmValidate):
131         * bmalloc/mbmalloc.cpp:
132
133 2014-04-07  Geoffrey Garen  <ggaren@apple.com>
134
135         bmalloc: Fixed a leak in the per-thread cache
136         https://bugs.webkit.org/show_bug.cgi?id=131330
137
138         Reviewed by Andreas Kling.
139
140         Remember to deallocate our line caches upon thread exit.
141
142         * bmalloc/Deallocator.cpp:
143         (bmalloc::Deallocator::~Deallocator):
144
145 2014-04-07  Geoffrey Garen  <ggaren@apple.com>
146
147         bmalloc: rolled out the tryLock experiment
148         https://bugs.webkit.org/show_bug.cgi?id=131328
149
150         Reviewed by Andreas Kling.
151
152         It wasn't a speedup.
153
154         * bmalloc.xcodeproj/project.pbxproj:
155         * bmalloc/Allocator.cpp:
156         (bmalloc::Allocator::processSmallAllocatorLog):
157         (bmalloc::Allocator::processMediumAllocatorLog):
158         * bmalloc/Deallocator.cpp:
159         (bmalloc::Deallocator::processObjectLog):
160         (bmalloc::Deallocator::deallocateSlowCase):
161         (bmalloc::Deallocator::deallocateSmallLine):
162         (bmalloc::Deallocator::deallocateMediumLine):
163         * bmalloc/Deallocator.h:
164         (bmalloc::Deallocator::deallocateFastCase):
165         * bmalloc/Heap.h:
166         (bmalloc::Heap::deallocateSmallLine):
167         (bmalloc::Heap::deallocateMediumLine):
168         * bmalloc/Line.h:
169         (bmalloc::Line<Traits>::deref):
170         * bmalloc/Page.h:
171         (bmalloc::Page<Traits>::deref):
172
173 2014-04-07  Geoffrey Garen  <ggaren@apple.com>
174
175         bmalloc
176         https://bugs.webkit.org/show_bug.cgi?id=131170
177
178         Reviewed by Andreas Kling.
179
180         Initial commit.
181
182         * bmalloc: Added.
183         * bmalloc.xcodeproj: Added.
184         * bmalloc.xcodeproj/project.pbxproj: Added.
185         * bmalloc/Algorithm.h: Added.
186         (bmalloc::max):
187         (bmalloc::min):
188         (bmalloc::mask):
189         (bmalloc::test):
190         (bmalloc::roundUpToMultipleOf):
191         (bmalloc::roundDownToMultipleOf):
192         (bmalloc::sizeOf):
193         (bmalloc::bitCount):
194         (bmalloc::isPowerOfTwo):
195         * bmalloc/Allocator.cpp: Added.
196         (bmalloc::Allocator::Allocator):
197         (bmalloc::Allocator::~Allocator):
198         (bmalloc::Allocator::log):
199         (bmalloc::Allocator::processSmallAllocatorLog):
200         (bmalloc::Allocator::processMediumAllocatorLog):
201         (bmalloc::Allocator::allocateLarge):
202         (bmalloc::Allocator::allocateXLarge):
203         (bmalloc::Allocator::allocateMedium):
204         (bmalloc::Allocator::allocateSlowCase):
205         * bmalloc/Allocator.h: Added.
206         (bmalloc::Allocator::smallAllocatorFor):
207         (bmalloc::Allocator::allocateFastCase):
208         (bmalloc::Allocator::allocate):
209         * bmalloc/AsyncTask.cpp: Added.
210         (bmalloc::AsyncTask<Function>::runSlowCase):
211         (bmalloc::AsyncTask<Function>::pthreadEntryPoint):
212         (bmalloc::AsyncTask<Function>::entryPoint):
213         * bmalloc/AsyncTask.h: Added.
214         (bmalloc::Function>::AsyncTask):
215         (bmalloc::Function>::join):
216         (bmalloc::Function>::run):
217         (bmalloc::Function>::runSlowCase):
218         (bmalloc::Function>::pthreadEntryPoint):
219         (bmalloc::Function>::entryPoint):
220         * bmalloc/BAssert.h: Added.
221         * bmalloc/BeginTag.h: Added.
222         (bmalloc::BeginTag::isInFreeList):
223         * bmalloc/BoundaryTag.h: Added.
224         (bmalloc::BoundaryTag::isXLarge):
225         (bmalloc::BoundaryTag::setXLarge):
226         (bmalloc::BoundaryTag::isFree):
227         (bmalloc::BoundaryTag::setFree):
228         (bmalloc::BoundaryTag::isEnd):
229         (bmalloc::BoundaryTag::setEnd):
230         (bmalloc::BoundaryTag::hasPhysicalPages):
231         (bmalloc::BoundaryTag::setHasPhysicalPages):
232         (bmalloc::BoundaryTag::isNull):
233         (bmalloc::BoundaryTag::clear):
234         (bmalloc::BoundaryTag::size):
235         (bmalloc::BoundaryTag::setSize):
236         (bmalloc::BoundaryTag::prev):
237         (bmalloc::BoundaryTag::next):
238         * bmalloc/BoundaryTagInlines.h: Added.
239         (bmalloc::validate):
240         (bmalloc::validatePrev):
241         (bmalloc::validateNext):
242         (bmalloc::BoundaryTag::init):
243         (bmalloc::BoundaryTag::mergeLargeLeft):
244         (bmalloc::BoundaryTag::mergeLargeRight):
245         (bmalloc::BoundaryTag::mergeLarge):
246         (bmalloc::BoundaryTag::deallocate):
247         (bmalloc::BoundaryTag::splitLarge):
248         (bmalloc::BoundaryTag::allocate):
249         * bmalloc/Cache.cpp: Added.
250         (bmalloc::Cache::operator new):
251         (bmalloc::Cache::operator delete):
252         (bmalloc::Cache::Cache):
253         (bmalloc::Cache::allocateSlowCase):
254         (bmalloc::Cache::allocateSlowCaseNullCache):
255         (bmalloc::Cache::deallocateSlowCase):
256         (bmalloc::Cache::deallocateSlowCaseNullCache):
257         * bmalloc/Cache.h: Added.
258         (bmalloc::Cache::allocator):
259         (bmalloc::Cache::deallocator):
260         (bmalloc::Cache::allocateFastCase):
261         (bmalloc::Cache::deallocateFastCase):
262         (bmalloc::Cache::allocate):
263         (bmalloc::Cache::deallocate):
264         * bmalloc/Chunk.h: Added.
265         (bmalloc::Chunk::begin):
266         (bmalloc::Chunk::end):
267         (bmalloc::Chunk::lines):
268         (bmalloc::Chunk::pages):
269         * bmalloc/Deallocator.cpp: Added.
270         (bmalloc::Deallocator::Deallocator):
271         (bmalloc::Deallocator::~Deallocator):
272         (bmalloc::Deallocator::deallocateLarge):
273         (bmalloc::Deallocator::deallocateXLarge):
274         (bmalloc::Deallocator::processObjectLog):
275         (bmalloc::Deallocator::deallocateSlowCase):
276         (bmalloc::Deallocator::deallocateSmallLine):
277         (bmalloc::Deallocator::allocateSmallLine):
278         (bmalloc::Deallocator::deallocateMediumLine):
279         (bmalloc::Deallocator::allocateMediumLine):
280         * bmalloc/Deallocator.h: Added.
281         (bmalloc::Deallocator::deallocateFastCase):
282         (bmalloc::Deallocator::deallocate):
283         * bmalloc/EndTag.h: Added.
284         (bmalloc::EndTag::operator=):
285         * bmalloc/FixedVector.h: Added.
286         (bmalloc::FixedVector::begin):
287         (bmalloc::FixedVector::end):
288         (bmalloc::FixedVector::size):
289         (bmalloc::FixedVector::capacity):
290         (bmalloc::FixedVector::clear):
291         (bmalloc::FixedVector::isEmpty):
292         (bmalloc::Capacity>::FixedVector):
293         (bmalloc::Capacity>::operator):
294         (bmalloc::Capacity>::push):
295         (bmalloc::Capacity>::pop):
296         (bmalloc::Capacity>::shrink):
297         * bmalloc/Heap.cpp: Added.
298         (bmalloc::sleep):
299         (bmalloc::Heap::Heap):
300         (bmalloc::Heap::concurrentScavenge):
301         (bmalloc::Heap::scavengeSmallPages):
302         (bmalloc::Heap::scavengeMediumPages):
303         (bmalloc::Heap::scavengeLargeRanges):
304         (bmalloc::Heap::allocateSmallLineSlowCase):
305         (bmalloc::Heap::allocateMediumLineSlowCase):
306         (bmalloc::Heap::allocateXLarge):
307         (bmalloc::Heap::deallocateXLarge):
308         (bmalloc::Heap::allocateLarge):
309         (bmalloc::Heap::deallocateLarge):
310         * bmalloc/Heap.h: Added.
311         (bmalloc::Heap::deallocateSmallLine):
312         (bmalloc::Heap::allocateSmallLine):
313         (bmalloc::Heap::deallocateMediumLine):
314         (bmalloc::Heap::allocateMediumLine):
315         * bmalloc/Inline.h: Added.
316         * bmalloc/LargeChunk.h: Added.
317         (bmalloc::LargeChunk::begin):
318         (bmalloc::LargeChunk::end):
319         (bmalloc::LargeChunk::create):
320         (bmalloc::LargeChunk::get):
321         (bmalloc::LargeChunk::beginTag):
322         (bmalloc::LargeChunk::endTag):
323         * bmalloc/Line.h: Added.
324         (bmalloc::Line<Traits>::begin):
325         (bmalloc::Line<Traits>::end):
326         (bmalloc::Line<Traits>::concurrentRef):
327         (bmalloc::Line<Traits>::deref):
328         * bmalloc/MediumAllocator.h: Added.
329         (bmalloc::MediumAllocator::isNull):
330         (bmalloc::MediumAllocator::MediumAllocator):
331         (bmalloc::MediumAllocator::line):
332         (bmalloc::MediumAllocator::allocate):
333         (bmalloc::MediumAllocator::derefCount):
334         (bmalloc::MediumAllocator::refill):
335         * bmalloc/MediumChunk.h: Added.
336         * bmalloc/MediumLine.h: Added.
337         * bmalloc/MediumPage.h: Added.
338         * bmalloc/MediumTraits.h: Added.
339         * bmalloc/Mutex.cpp: Added.
340         (bmalloc::Mutex::lockSlowCase):
341         * bmalloc/Mutex.h: Added.
342         (bmalloc::Mutex::Mutex):
343         (bmalloc::Mutex::try_lock):
344         (bmalloc::Mutex::lock):
345         (bmalloc::Mutex::unlock):
346         * bmalloc/ObjectType.cpp: Added.
347         (bmalloc::objectType):
348         * bmalloc/ObjectType.h: Added.
349         (bmalloc::isSmallOrMedium):
350         (bmalloc::isSmall):
351         * bmalloc/Page.h: Added.
352         (bmalloc::Page<Traits>::ref):
353         (bmalloc::Page<Traits>::deref):
354         (bmalloc::Page<Traits>::refCount):
355         * bmalloc/PerProcess.h: Added.
356         (bmalloc::PerProcess::mutex):
357         (bmalloc::PerProcess<T>::getFastCase):
358         (bmalloc::PerProcess<T>::get):
359         (bmalloc::PerProcess<T>::getSlowCase):
360         * bmalloc/PerThread.h: Added.
361         (bmalloc::PerThreadStorage<Cache>::get):
362         (bmalloc::PerThreadStorage<Cache>::init):
363         (bmalloc::PerThreadStorage::get):
364         (bmalloc::PerThreadStorage::init):
365         (bmalloc::PerThread<T>::getFastCase):
366         (bmalloc::PerThread<T>::get):
367         (bmalloc::PerThread<T>::destructor):
368         (bmalloc::PerThread<T>::getSlowCase):
369         * bmalloc/Range.h: Added.
370         (bmalloc::Range::Range):
371         (bmalloc::Range::begin):
372         (bmalloc::Range::end):
373         (bmalloc::Range::size):
374         (bmalloc::Range::operator!):
375         (bmalloc::Range::operator<):
376         * bmalloc/SegregatedFreeList.cpp: Added.
377         (bmalloc::SegregatedFreeList::SegregatedFreeList):
378         (bmalloc::SegregatedFreeList::insert):
379         (bmalloc::SegregatedFreeList::takeGreedy):
380         (bmalloc::SegregatedFreeList::take):
381         * bmalloc/SegregatedFreeList.h: Added.
382         * bmalloc/Sizes.h: Added.
383         * bmalloc/SmallAllocator.h: Added.
384         (bmalloc::SmallAllocator::isNull):
385         (bmalloc::SmallAllocator::canAllocate):
386         (bmalloc::SmallAllocator::SmallAllocator):
387         (bmalloc::SmallAllocator::line):
388         (bmalloc::SmallAllocator::allocate):
389         (bmalloc::SmallAllocator::objectCount):
390         (bmalloc::SmallAllocator::derefCount):
391         (bmalloc::SmallAllocator::refill):
392         * bmalloc/SmallChunk.h: Added.
393         * bmalloc/SmallLine.h: Added.
394         * bmalloc/SmallPage.h: Added.
395         * bmalloc/SmallTraits.h: Added.
396         * bmalloc/Syscall.h: Added.
397         * bmalloc/VMAllocate.h: Added.
398         (bmalloc::vmSize):
399         (bmalloc::vmValidate):
400         (bmalloc::vmAllocate):
401         (bmalloc::vmDeallocate):
402         (bmalloc::vmDeallocatePhysicalPages):
403         (bmalloc::vmAllocatePhysicalPages):
404         (bmalloc::vmDeallocatePhysicalPagesSloppy):
405         (bmalloc::vmAllocatePhysicalPagesSloppy):
406         * bmalloc/VMHeap.cpp: Added.
407         (bmalloc::VMHeap::VMHeap):
408         (bmalloc::VMHeap::allocateSmallChunk):
409         (bmalloc::VMHeap::allocateMediumChunk):
410         (bmalloc::VMHeap::allocateLargeChunk):
411         * bmalloc/VMHeap.h: Added.
412         (bmalloc::VMHeap::allocateSmallPage):
413         (bmalloc::VMHeap::allocateMediumPage):
414         (bmalloc::VMHeap::allocateLargeRange):
415         (bmalloc::VMHeap::deallocateSmallPage):
416         (bmalloc::VMHeap::deallocateMediumPage):
417         (bmalloc::VMHeap::deallocateLargeRange):
418         * bmalloc/Vector.h: Added.
419         (bmalloc::Vector::begin):
420         (bmalloc::Vector::end):
421         (bmalloc::Vector::size):
422         (bmalloc::Vector::capacity):
423         (bmalloc::Vector::last):
424         (bmalloc::Vector::pop):
425         (bmalloc::Vector<T>::Vector):
426         (bmalloc::Vector<T>::~Vector):
427         (bmalloc::Vector<T>::operator):
428         (bmalloc::Vector<T>::push):
429         (bmalloc::Vector<T>::pop):
430         (bmalloc::Vector<T>::shrink):
431         (bmalloc::Vector<T>::reallocateBuffer):
432         (bmalloc::Vector<T>::shrinkCapacity):
433         (bmalloc::Vector<T>::growCapacity):
434         * bmalloc/XLargeChunk.h: Added.
435         (bmalloc::XLargeChunk::get):
436         (bmalloc::XLargeChunk::begin):
437         (bmalloc::XLargeChunk::XLargeChunk):
438         (bmalloc::XLargeChunk::create):
439         (bmalloc::XLargeChunk::destroy):
440         (bmalloc::XLargeChunk::range):
441         (bmalloc::XLargeChunk::size):
442         * bmalloc/bmalloc.h: Added.
443         (bmalloc::api::malloc):
444         (bmalloc::api::free):
445         (bmalloc::api::realloc):
446         * bmalloc/mbmalloc.cpp: Added.
447