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

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

Issue 2394683005: Remove ASSERT_UNUSED (Closed)
Patch Set: Created 4 years, 2 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
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 223 matching lines...) Expand 10 before | Expand all | Expand 10 after
234 if (m_threadStackSize) 234 if (m_threadStackSize)
235 return m_threadStackSize; 235 return m_threadStackSize;
236 236
237 // Notice that we cannot use the TIB's StackLimit for the stack end, as it 237 // Notice that we cannot use the TIB's StackLimit for the stack end, as it
238 // tracks the end of the committed range. We're after the end of the reserved 238 // tracks the end of the committed range. We're after the end of the reserved
239 // stack area (most of which will be uncommitted, most times.) 239 // stack area (most of which will be uncommitted, most times.)
240 MEMORY_BASIC_INFORMATION stackInfo; 240 MEMORY_BASIC_INFORMATION stackInfo;
241 memset(&stackInfo, 0, sizeof(MEMORY_BASIC_INFORMATION)); 241 memset(&stackInfo, 0, sizeof(MEMORY_BASIC_INFORMATION));
242 size_t resultSize = 242 size_t resultSize =
243 VirtualQuery(&stackInfo, &stackInfo, sizeof(MEMORY_BASIC_INFORMATION)); 243 VirtualQuery(&stackInfo, &stackInfo, sizeof(MEMORY_BASIC_INFORMATION));
244 ASSERT_UNUSED(resultSize, resultSize >= sizeof(MEMORY_BASIC_INFORMATION)); 244 DCHECK_GE(resultSize, sizeof(MEMORY_BASIC_INFORMATION));
245 Address stackEnd = reinterpret_cast<Address>(stackInfo.AllocationBase); 245 Address stackEnd = reinterpret_cast<Address>(stackInfo.AllocationBase);
246 246
247 Address stackStart = 247 Address stackStart =
248 reinterpret_cast<Address>(StackFrameDepth::getStackStart()); 248 reinterpret_cast<Address>(StackFrameDepth::getStackStart());
249 RELEASE_ASSERT(stackStart && stackStart > stackEnd); 249 RELEASE_ASSERT(stackStart && stackStart > stackEnd);
250 m_threadStackSize = static_cast<size_t>(stackStart - stackEnd); 250 m_threadStackSize = static_cast<size_t>(stackStart - stackEnd);
251 // When the third last page of the reserved stack is accessed as a 251 // When the third last page of the reserved stack is accessed as a
252 // guard page, the second last page will be committed (along with removing 252 // guard page, the second last page will be committed (along with removing
253 // the guard bit on the third last) _and_ a stack overflow exception 253 // the guard bit on the third last) _and_ a stack overflow exception
254 // is raised. 254 // is raised.
(...skipping 1563 matching lines...) Expand 10 before | Expand all | Expand 10 after
1818 collectGarbage(BlinkGC::NoHeapPointersOnStack, BlinkGC::GCWithSweep, 1818 collectGarbage(BlinkGC::NoHeapPointersOnStack, BlinkGC::GCWithSweep,
1819 BlinkGC::ForcedGC); 1819 BlinkGC::ForcedGC);
1820 size_t liveObjects = heap().heapStats().markedObjectSize(); 1820 size_t liveObjects = heap().heapStats().markedObjectSize();
1821 if (liveObjects == previousLiveObjects) 1821 if (liveObjects == previousLiveObjects)
1822 break; 1822 break;
1823 previousLiveObjects = liveObjects; 1823 previousLiveObjects = liveObjects;
1824 } 1824 }
1825 } 1825 }
1826 1826
1827 } // namespace blink 1827 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698