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