Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(191)

Side by Side Diff: third_party/WebKit/Source/platform/heap/ThreadState.cpp

Issue 2951673002: Determine stability of system_health:memory_mobile results.
Patch Set: Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 } 168 }
169 169
170 void ThreadState::DetachCurrentThread() { 170 void ThreadState::DetachCurrentThread() {
171 ThreadState* state = Current(); 171 ThreadState* state = Current();
172 state->RunTerminationGC(); 172 state->RunTerminationGC();
173 delete state; 173 delete state;
174 } 174 }
175 175
176 void ThreadState::RemoveAllPages() { 176 void ThreadState::RemoveAllPages() {
177 DCHECK(CheckThread()); 177 DCHECK(CheckThread());
178 for (int i = 0; i < BlinkGC::kNumberOfArenas; ++i) 178 for (int i = 0; i < BlinkGC::kNumberOfArenas; ++i) {
179 arenas_[i]->RemoveAllPages(); 179 arenas_[i]->RemoveAllPages();
180 }
180 } 181 }
181 182
182 void ThreadState::RunTerminationGC() { 183 void ThreadState::RunTerminationGC() {
183 if (IsMainThread()) { 184 if (IsMainThread()) {
184 RemoveAllPages(); 185 RemoveAllPages();
185 return; 186 return;
186 } 187 }
187 DCHECK(CheckThread()); 188 DCHECK(CheckThread());
188 189
189 // Finish sweeping. 190 // Finish sweeping.
(...skipping 1379 matching lines...) Expand 10 before | Expand all | Expand 10 after
1569 CollectGarbage(BlinkGC::kNoHeapPointersOnStack, BlinkGC::kGCWithSweep, 1570 CollectGarbage(BlinkGC::kNoHeapPointersOnStack, BlinkGC::kGCWithSweep,
1570 BlinkGC::kForcedGC); 1571 BlinkGC::kForcedGC);
1571 size_t live_objects = Heap().HeapStats().MarkedObjectSize(); 1572 size_t live_objects = Heap().HeapStats().MarkedObjectSize();
1572 if (live_objects == previous_live_objects) 1573 if (live_objects == previous_live_objects)
1573 break; 1574 break;
1574 previous_live_objects = live_objects; 1575 previous_live_objects = live_objects;
1575 } 1576 }
1576 } 1577 }
1577 1578
1578 } // namespace blink 1579 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698