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