OLD | NEW |
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 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
195 atomicAdd(&m_allocatedSpace, static_cast<long>(delta)); | 195 atomicAdd(&m_allocatedSpace, static_cast<long>(delta)); |
196 ProcessHeap::increaseTotalAllocatedSpace(delta); | 196 ProcessHeap::increaseTotalAllocatedSpace(delta); |
197 } | 197 } |
198 | 198 |
199 void ThreadHeapStats::decreaseAllocatedSpace(size_t delta) { | 199 void ThreadHeapStats::decreaseAllocatedSpace(size_t delta) { |
200 atomicSubtract(&m_allocatedSpace, static_cast<long>(delta)); | 200 atomicSubtract(&m_allocatedSpace, static_cast<long>(delta)); |
201 ProcessHeap::decreaseTotalAllocatedSpace(delta); | 201 ProcessHeap::decreaseTotalAllocatedSpace(delta); |
202 } | 202 } |
203 | 203 |
204 ThreadHeap::ThreadHeap() | 204 ThreadHeap::ThreadHeap() |
205 : m_regionTree(makeUnique<RegionTree>()), | 205 : m_regionTree(WTF::makeUnique<RegionTree>()), |
206 m_heapDoesNotContainCache(wrapUnique(new HeapDoesNotContainCache)), | 206 m_heapDoesNotContainCache(WTF::wrapUnique(new HeapDoesNotContainCache)), |
207 m_safePointBarrier(makeUnique<SafePointBarrier>()), | 207 m_safePointBarrier(WTF::makeUnique<SafePointBarrier>()), |
208 m_freePagePool(wrapUnique(new FreePagePool)), | 208 m_freePagePool(WTF::wrapUnique(new FreePagePool)), |
209 m_orphanedPagePool(wrapUnique(new OrphanedPagePool)), | 209 m_orphanedPagePool(WTF::wrapUnique(new OrphanedPagePool)), |
210 m_markingStack(CallbackStack::create()), | 210 m_markingStack(CallbackStack::create()), |
211 m_postMarkingCallbackStack(CallbackStack::create()), | 211 m_postMarkingCallbackStack(CallbackStack::create()), |
212 m_globalWeakCallbackStack(CallbackStack::create()), | 212 m_globalWeakCallbackStack(CallbackStack::create()), |
213 m_ephemeronStack(CallbackStack::create()) { | 213 m_ephemeronStack(CallbackStack::create()) { |
214 if (ThreadState::current()->isMainThread()) | 214 if (ThreadState::current()->isMainThread()) |
215 s_mainThreadHeap = this; | 215 s_mainThreadHeap = this; |
216 | 216 |
217 MutexLocker locker(ThreadHeap::allHeapsMutex()); | 217 MutexLocker locker(ThreadHeap::allHeapsMutex()); |
218 allHeaps().add(this); | 218 allHeaps().add(this); |
219 } | 219 } |
(...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
641 ProcessHeap::decreaseTotalMarkedObjectSize(m_stats.markedObjectSize()); | 641 ProcessHeap::decreaseTotalMarkedObjectSize(m_stats.markedObjectSize()); |
642 | 642 |
643 m_stats.reset(); | 643 m_stats.reset(); |
644 for (ThreadState* state : m_threads) | 644 for (ThreadState* state : m_threads) |
645 state->resetHeapCounters(); | 645 state->resetHeapCounters(); |
646 } | 646 } |
647 | 647 |
648 ThreadHeap* ThreadHeap::s_mainThreadHeap = nullptr; | 648 ThreadHeap* ThreadHeap::s_mainThreadHeap = nullptr; |
649 | 649 |
650 } // namespace blink | 650 } // namespace blink |
OLD | NEW |