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

Side by Side Diff: third_party/WebKit/Source/platform/heap/Heap.h

Issue 1853423003: Fix incorrect blink_gc memory dump caused by r383965 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 | third_party/WebKit/Source/platform/heap/Heap.cpp » ('j') | 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 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 112
113 static bool isLowEndDevice() { return s_isLowEndDevice; } 113 static bool isLowEndDevice() { return s_isLowEndDevice; }
114 static void increaseTotalAllocatedObjectSize(size_t delta) { atomicAdd(&s_to talAllocatedObjectSize, static_cast<long>(delta)); } 114 static void increaseTotalAllocatedObjectSize(size_t delta) { atomicAdd(&s_to talAllocatedObjectSize, static_cast<long>(delta)); }
115 static void decreaseTotalAllocatedObjectSize(size_t delta) { atomicSubtract( &s_totalAllocatedObjectSize, static_cast<long>(delta)); } 115 static void decreaseTotalAllocatedObjectSize(size_t delta) { atomicSubtract( &s_totalAllocatedObjectSize, static_cast<long>(delta)); }
116 static size_t totalAllocatedObjectSize() { return acquireLoad(&s_totalAlloca tedObjectSize); } 116 static size_t totalAllocatedObjectSize() { return acquireLoad(&s_totalAlloca tedObjectSize); }
117 static void increaseTotalMarkedObjectSize(size_t delta) { atomicAdd(&s_total MarkedObjectSize, static_cast<long>(delta)); } 117 static void increaseTotalMarkedObjectSize(size_t delta) { atomicAdd(&s_total MarkedObjectSize, static_cast<long>(delta)); }
118 static size_t totalMarkedObjectSize() { return acquireLoad(&s_totalMarkedObj ectSize); } 118 static size_t totalMarkedObjectSize() { return acquireLoad(&s_totalMarkedObj ectSize); }
119 static void increaseTotalAllocatedSpace(size_t delta) { atomicAdd(&s_totalAl locatedSpace, static_cast<long>(delta)); } 119 static void increaseTotalAllocatedSpace(size_t delta) { atomicAdd(&s_totalAl locatedSpace, static_cast<long>(delta)); }
120 static void decreaseTotalAllocatedSpace(size_t delta) { atomicSubtract(&s_to talAllocatedSpace, static_cast<long>(delta)); } 120 static void decreaseTotalAllocatedSpace(size_t delta) { atomicSubtract(&s_to talAllocatedSpace, static_cast<long>(delta)); }
121 static size_t totalAllocatedSpace() { return acquireLoad(&s_totalAllocatedSp ace); } 121 static size_t totalAllocatedSpace() { return acquireLoad(&s_totalAllocatedSp ace); }
122 static void resetHeapCounters();
122 123
123 private: 124 private:
124 static bool s_isLowEndDevice; 125 static bool s_isLowEndDevice;
125 static size_t s_totalAllocatedSpace; 126 static size_t s_totalAllocatedSpace;
126 static size_t s_totalAllocatedObjectSize; 127 static size_t s_totalAllocatedObjectSize;
127 static size_t s_totalMarkedObjectSize; 128 static size_t s_totalMarkedObjectSize;
128 129
129 friend class ThreadState; 130 friend class ThreadState;
130 }; 131 };
131 132
(...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after
550 void VisitorHelper<Derived>::handleWeakCell(Visitor* self, void* object) 551 void VisitorHelper<Derived>::handleWeakCell(Visitor* self, void* object)
551 { 552 {
552 T** cell = reinterpret_cast<T**>(object); 553 T** cell = reinterpret_cast<T**>(object);
553 if (*cell && !ObjectAliveTrait<T>::isHeapObjectAlive(*cell)) 554 if (*cell && !ObjectAliveTrait<T>::isHeapObjectAlive(*cell))
554 *cell = nullptr; 555 *cell = nullptr;
555 } 556 }
556 557
557 } // namespace blink 558 } // namespace blink
558 559
559 #endif // Heap_h 560 #endif // Heap_h
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/heap/Heap.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698