bmalloc: Fixed a leak in the per-thread cache
[WebKit-https.git] / Source / bmalloc / ChangeLog
1 2014-04-07  Geoffrey Garen  <ggaren@apple.com>
2
3         bmalloc: Fixed a leak in the per-thread cache
4         https://bugs.webkit.org/show_bug.cgi?id=131330
5
6         Reviewed by Andreas Kling.
7
8         Remember to deallocate our line caches upon thread exit.
9
10         * bmalloc/Deallocator.cpp:
11         (bmalloc::Deallocator::~Deallocator):
12
13 2014-04-07  Geoffrey Garen  <ggaren@apple.com>
14
15         bmalloc: rolled out the tryLock experiment
16         https://bugs.webkit.org/show_bug.cgi?id=131328
17
18         Reviewed by Andreas Kling.
19
20         It wasn't a speedup.
21
22         * bmalloc.xcodeproj/project.pbxproj:
23         * bmalloc/Allocator.cpp:
24         (bmalloc::Allocator::processSmallAllocatorLog):
25         (bmalloc::Allocator::processMediumAllocatorLog):
26         * bmalloc/Deallocator.cpp:
27         (bmalloc::Deallocator::processObjectLog):
28         (bmalloc::Deallocator::deallocateSlowCase):
29         (bmalloc::Deallocator::deallocateSmallLine):
30         (bmalloc::Deallocator::deallocateMediumLine):
31         * bmalloc/Deallocator.h:
32         (bmalloc::Deallocator::deallocateFastCase):
33         * bmalloc/Heap.h:
34         (bmalloc::Heap::deallocateSmallLine):
35         (bmalloc::Heap::deallocateMediumLine):
36         * bmalloc/Line.h:
37         (bmalloc::Line<Traits>::deref):
38         * bmalloc/Page.h:
39         (bmalloc::Page<Traits>::deref):
40
41 2014-04-07  Geoffrey Garen  <ggaren@apple.com>
42
43         bmalloc
44         https://bugs.webkit.org/show_bug.cgi?id=131170
45
46         Reviewed by Andreas Kling.
47
48         Initial commit.
49
50         * bmalloc: Added.
51         * bmalloc.xcodeproj: Added.
52         * bmalloc.xcodeproj/project.pbxproj: Added.
53         * bmalloc/Algorithm.h: Added.
54         (bmalloc::max):
55         (bmalloc::min):
56         (bmalloc::mask):
57         (bmalloc::test):
58         (bmalloc::roundUpToMultipleOf):
59         (bmalloc::roundDownToMultipleOf):
60         (bmalloc::sizeOf):
61         (bmalloc::bitCount):
62         (bmalloc::isPowerOfTwo):
63         * bmalloc/Allocator.cpp: Added.
64         (bmalloc::Allocator::Allocator):
65         (bmalloc::Allocator::~Allocator):
66         (bmalloc::Allocator::log):
67         (bmalloc::Allocator::processSmallAllocatorLog):
68         (bmalloc::Allocator::processMediumAllocatorLog):
69         (bmalloc::Allocator::allocateLarge):
70         (bmalloc::Allocator::allocateXLarge):
71         (bmalloc::Allocator::allocateMedium):
72         (bmalloc::Allocator::allocateSlowCase):
73         * bmalloc/Allocator.h: Added.
74         (bmalloc::Allocator::smallAllocatorFor):
75         (bmalloc::Allocator::allocateFastCase):
76         (bmalloc::Allocator::allocate):
77         * bmalloc/AsyncTask.cpp: Added.
78         (bmalloc::AsyncTask<Function>::runSlowCase):
79         (bmalloc::AsyncTask<Function>::pthreadEntryPoint):
80         (bmalloc::AsyncTask<Function>::entryPoint):
81         * bmalloc/AsyncTask.h: Added.
82         (bmalloc::Function>::AsyncTask):
83         (bmalloc::Function>::join):
84         (bmalloc::Function>::run):
85         (bmalloc::Function>::runSlowCase):
86         (bmalloc::Function>::pthreadEntryPoint):
87         (bmalloc::Function>::entryPoint):
88         * bmalloc/BAssert.h: Added.
89         * bmalloc/BeginTag.h: Added.
90         (bmalloc::BeginTag::isInFreeList):
91         * bmalloc/BoundaryTag.h: Added.
92         (bmalloc::BoundaryTag::isXLarge):
93         (bmalloc::BoundaryTag::setXLarge):
94         (bmalloc::BoundaryTag::isFree):
95         (bmalloc::BoundaryTag::setFree):
96         (bmalloc::BoundaryTag::isEnd):
97         (bmalloc::BoundaryTag::setEnd):
98         (bmalloc::BoundaryTag::hasPhysicalPages):
99         (bmalloc::BoundaryTag::setHasPhysicalPages):
100         (bmalloc::BoundaryTag::isNull):
101         (bmalloc::BoundaryTag::clear):
102         (bmalloc::BoundaryTag::size):
103         (bmalloc::BoundaryTag::setSize):
104         (bmalloc::BoundaryTag::prev):
105         (bmalloc::BoundaryTag::next):
106         * bmalloc/BoundaryTagInlines.h: Added.
107         (bmalloc::validate):
108         (bmalloc::validatePrev):
109         (bmalloc::validateNext):
110         (bmalloc::BoundaryTag::init):
111         (bmalloc::BoundaryTag::mergeLargeLeft):
112         (bmalloc::BoundaryTag::mergeLargeRight):
113         (bmalloc::BoundaryTag::mergeLarge):
114         (bmalloc::BoundaryTag::deallocate):
115         (bmalloc::BoundaryTag::splitLarge):
116         (bmalloc::BoundaryTag::allocate):
117         * bmalloc/Cache.cpp: Added.
118         (bmalloc::Cache::operator new):
119         (bmalloc::Cache::operator delete):
120         (bmalloc::Cache::Cache):
121         (bmalloc::Cache::allocateSlowCase):
122         (bmalloc::Cache::allocateSlowCaseNullCache):
123         (bmalloc::Cache::deallocateSlowCase):
124         (bmalloc::Cache::deallocateSlowCaseNullCache):
125         * bmalloc/Cache.h: Added.
126         (bmalloc::Cache::allocator):
127         (bmalloc::Cache::deallocator):
128         (bmalloc::Cache::allocateFastCase):
129         (bmalloc::Cache::deallocateFastCase):
130         (bmalloc::Cache::allocate):
131         (bmalloc::Cache::deallocate):
132         * bmalloc/Chunk.h: Added.
133         (bmalloc::Chunk::begin):
134         (bmalloc::Chunk::end):
135         (bmalloc::Chunk::lines):
136         (bmalloc::Chunk::pages):
137         * bmalloc/Deallocator.cpp: Added.
138         (bmalloc::Deallocator::Deallocator):
139         (bmalloc::Deallocator::~Deallocator):
140         (bmalloc::Deallocator::deallocateLarge):
141         (bmalloc::Deallocator::deallocateXLarge):
142         (bmalloc::Deallocator::processObjectLog):
143         (bmalloc::Deallocator::deallocateSlowCase):
144         (bmalloc::Deallocator::deallocateSmallLine):
145         (bmalloc::Deallocator::allocateSmallLine):
146         (bmalloc::Deallocator::deallocateMediumLine):
147         (bmalloc::Deallocator::allocateMediumLine):
148         * bmalloc/Deallocator.h: Added.
149         (bmalloc::Deallocator::deallocateFastCase):
150         (bmalloc::Deallocator::deallocate):
151         * bmalloc/EndTag.h: Added.
152         (bmalloc::EndTag::operator=):
153         * bmalloc/FixedVector.h: Added.
154         (bmalloc::FixedVector::begin):
155         (bmalloc::FixedVector::end):
156         (bmalloc::FixedVector::size):
157         (bmalloc::FixedVector::capacity):
158         (bmalloc::FixedVector::clear):
159         (bmalloc::FixedVector::isEmpty):
160         (bmalloc::Capacity>::FixedVector):
161         (bmalloc::Capacity>::operator):
162         (bmalloc::Capacity>::push):
163         (bmalloc::Capacity>::pop):
164         (bmalloc::Capacity>::shrink):
165         * bmalloc/Heap.cpp: Added.
166         (bmalloc::sleep):
167         (bmalloc::Heap::Heap):
168         (bmalloc::Heap::concurrentScavenge):
169         (bmalloc::Heap::scavengeSmallPages):
170         (bmalloc::Heap::scavengeMediumPages):
171         (bmalloc::Heap::scavengeLargeRanges):
172         (bmalloc::Heap::allocateSmallLineSlowCase):
173         (bmalloc::Heap::allocateMediumLineSlowCase):
174         (bmalloc::Heap::allocateXLarge):
175         (bmalloc::Heap::deallocateXLarge):
176         (bmalloc::Heap::allocateLarge):
177         (bmalloc::Heap::deallocateLarge):
178         * bmalloc/Heap.h: Added.
179         (bmalloc::Heap::deallocateSmallLine):
180         (bmalloc::Heap::allocateSmallLine):
181         (bmalloc::Heap::deallocateMediumLine):
182         (bmalloc::Heap::allocateMediumLine):
183         * bmalloc/Inline.h: Added.
184         * bmalloc/LargeChunk.h: Added.
185         (bmalloc::LargeChunk::begin):
186         (bmalloc::LargeChunk::end):
187         (bmalloc::LargeChunk::create):
188         (bmalloc::LargeChunk::get):
189         (bmalloc::LargeChunk::beginTag):
190         (bmalloc::LargeChunk::endTag):
191         * bmalloc/Line.h: Added.
192         (bmalloc::Line<Traits>::begin):
193         (bmalloc::Line<Traits>::end):
194         (bmalloc::Line<Traits>::concurrentRef):
195         (bmalloc::Line<Traits>::deref):
196         * bmalloc/MediumAllocator.h: Added.
197         (bmalloc::MediumAllocator::isNull):
198         (bmalloc::MediumAllocator::MediumAllocator):
199         (bmalloc::MediumAllocator::line):
200         (bmalloc::MediumAllocator::allocate):
201         (bmalloc::MediumAllocator::derefCount):
202         (bmalloc::MediumAllocator::refill):
203         * bmalloc/MediumChunk.h: Added.
204         * bmalloc/MediumLine.h: Added.
205         * bmalloc/MediumPage.h: Added.
206         * bmalloc/MediumTraits.h: Added.
207         * bmalloc/Mutex.cpp: Added.
208         (bmalloc::Mutex::lockSlowCase):
209         * bmalloc/Mutex.h: Added.
210         (bmalloc::Mutex::Mutex):
211         (bmalloc::Mutex::try_lock):
212         (bmalloc::Mutex::lock):
213         (bmalloc::Mutex::unlock):
214         * bmalloc/ObjectType.cpp: Added.
215         (bmalloc::objectType):
216         * bmalloc/ObjectType.h: Added.
217         (bmalloc::isSmallOrMedium):
218         (bmalloc::isSmall):
219         * bmalloc/Page.h: Added.
220         (bmalloc::Page<Traits>::ref):
221         (bmalloc::Page<Traits>::deref):
222         (bmalloc::Page<Traits>::refCount):
223         * bmalloc/PerProcess.h: Added.
224         (bmalloc::PerProcess::mutex):
225         (bmalloc::PerProcess<T>::getFastCase):
226         (bmalloc::PerProcess<T>::get):
227         (bmalloc::PerProcess<T>::getSlowCase):
228         * bmalloc/PerThread.h: Added.
229         (bmalloc::PerThreadStorage<Cache>::get):
230         (bmalloc::PerThreadStorage<Cache>::init):
231         (bmalloc::PerThreadStorage::get):
232         (bmalloc::PerThreadStorage::init):
233         (bmalloc::PerThread<T>::getFastCase):
234         (bmalloc::PerThread<T>::get):
235         (bmalloc::PerThread<T>::destructor):
236         (bmalloc::PerThread<T>::getSlowCase):
237         * bmalloc/Range.h: Added.
238         (bmalloc::Range::Range):
239         (bmalloc::Range::begin):
240         (bmalloc::Range::end):
241         (bmalloc::Range::size):
242         (bmalloc::Range::operator!):
243         (bmalloc::Range::operator<):
244         * bmalloc/SegregatedFreeList.cpp: Added.
245         (bmalloc::SegregatedFreeList::SegregatedFreeList):
246         (bmalloc::SegregatedFreeList::insert):
247         (bmalloc::SegregatedFreeList::takeGreedy):
248         (bmalloc::SegregatedFreeList::take):
249         * bmalloc/SegregatedFreeList.h: Added.
250         * bmalloc/Sizes.h: Added.
251         * bmalloc/SmallAllocator.h: Added.
252         (bmalloc::SmallAllocator::isNull):
253         (bmalloc::SmallAllocator::canAllocate):
254         (bmalloc::SmallAllocator::SmallAllocator):
255         (bmalloc::SmallAllocator::line):
256         (bmalloc::SmallAllocator::allocate):
257         (bmalloc::SmallAllocator::objectCount):
258         (bmalloc::SmallAllocator::derefCount):
259         (bmalloc::SmallAllocator::refill):
260         * bmalloc/SmallChunk.h: Added.
261         * bmalloc/SmallLine.h: Added.
262         * bmalloc/SmallPage.h: Added.
263         * bmalloc/SmallTraits.h: Added.
264         * bmalloc/Syscall.h: Added.
265         * bmalloc/VMAllocate.h: Added.
266         (bmalloc::vmSize):
267         (bmalloc::vmValidate):
268         (bmalloc::vmAllocate):
269         (bmalloc::vmDeallocate):
270         (bmalloc::vmDeallocatePhysicalPages):
271         (bmalloc::vmAllocatePhysicalPages):
272         (bmalloc::vmDeallocatePhysicalPagesSloppy):
273         (bmalloc::vmAllocatePhysicalPagesSloppy):
274         * bmalloc/VMHeap.cpp: Added.
275         (bmalloc::VMHeap::VMHeap):
276         (bmalloc::VMHeap::allocateSmallChunk):
277         (bmalloc::VMHeap::allocateMediumChunk):
278         (bmalloc::VMHeap::allocateLargeChunk):
279         * bmalloc/VMHeap.h: Added.
280         (bmalloc::VMHeap::allocateSmallPage):
281         (bmalloc::VMHeap::allocateMediumPage):
282         (bmalloc::VMHeap::allocateLargeRange):
283         (bmalloc::VMHeap::deallocateSmallPage):
284         (bmalloc::VMHeap::deallocateMediumPage):
285         (bmalloc::VMHeap::deallocateLargeRange):
286         * bmalloc/Vector.h: Added.
287         (bmalloc::Vector::begin):
288         (bmalloc::Vector::end):
289         (bmalloc::Vector::size):
290         (bmalloc::Vector::capacity):
291         (bmalloc::Vector::last):
292         (bmalloc::Vector::pop):
293         (bmalloc::Vector<T>::Vector):
294         (bmalloc::Vector<T>::~Vector):
295         (bmalloc::Vector<T>::operator):
296         (bmalloc::Vector<T>::push):
297         (bmalloc::Vector<T>::pop):
298         (bmalloc::Vector<T>::shrink):
299         (bmalloc::Vector<T>::reallocateBuffer):
300         (bmalloc::Vector<T>::shrinkCapacity):
301         (bmalloc::Vector<T>::growCapacity):
302         * bmalloc/XLargeChunk.h: Added.
303         (bmalloc::XLargeChunk::get):
304         (bmalloc::XLargeChunk::begin):
305         (bmalloc::XLargeChunk::XLargeChunk):
306         (bmalloc::XLargeChunk::create):
307         (bmalloc::XLargeChunk::destroy):
308         (bmalloc::XLargeChunk::range):
309         (bmalloc::XLargeChunk::size):
310         * bmalloc/bmalloc.h: Added.
311         (bmalloc::api::malloc):
312         (bmalloc::api::free):
313         (bmalloc::api::realloc):
314         * bmalloc/mbmalloc.cpp: Added.
315