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

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

Issue 1201773004: Oilpan: Trace Heap memory statistics more often. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 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 | Source/platform/heap/Heap.cpp » ('j') | Source/platform/heap/Heap.cpp » ('J')
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 1019 matching lines...) Expand 10 before | Expand all | Expand 10 after
1030 static void increaseAllocatedSpace(size_t delta) { atomicAdd(&s_allocatedSpa ce, static_cast<long>(delta)); } 1030 static void increaseAllocatedSpace(size_t delta) { atomicAdd(&s_allocatedSpa ce, static_cast<long>(delta)); }
1031 static void decreaseAllocatedSpace(size_t delta) { atomicSubtract(&s_allocat edSpace, static_cast<long>(delta)); } 1031 static void decreaseAllocatedSpace(size_t delta) { atomicSubtract(&s_allocat edSpace, static_cast<long>(delta)); }
1032 static size_t allocatedSpace() { return acquireLoad(&s_allocatedSpace); } 1032 static size_t allocatedSpace() { return acquireLoad(&s_allocatedSpace); }
1033 static size_t estimatedLiveObjectSize() { return acquireLoad(&s_estimatedLiv eObjectSize); } 1033 static size_t estimatedLiveObjectSize() { return acquireLoad(&s_estimatedLiv eObjectSize); }
1034 static void setEstimatedLiveObjectSize(size_t size) { releaseStore(&s_estima tedLiveObjectSize, size); } 1034 static void setEstimatedLiveObjectSize(size_t size) { releaseStore(&s_estima tedLiveObjectSize, size); }
1035 static size_t externalObjectSizeAtLastGC() { return acquireLoad(&s_externalO bjectSizeAtLastGC); } 1035 static size_t externalObjectSizeAtLastGC() { return acquireLoad(&s_externalO bjectSizeAtLastGC); }
1036 1036
1037 static double estimatedMarkingTime(); 1037 static double estimatedMarkingTime();
1038 static void reportMemoryUsageHistogram(); 1038 static void reportMemoryUsageHistogram();
1039 1039
1040 #if ENABLE(GC_PROFILING)
1041 static void reportMemoryUsageForTracing();
1042 #else
1043 static void reportMemoryUsageForTracing() { }
1044 #endif
1045
1040 private: 1046 private:
1041 // A RegionTree is a simple binary search tree of PageMemoryRegions sorted 1047 // A RegionTree is a simple binary search tree of PageMemoryRegions sorted
1042 // by base addresses. 1048 // by base addresses.
1043 class RegionTree { 1049 class RegionTree {
1044 public: 1050 public:
1045 explicit RegionTree(PageMemoryRegion* region) : m_region(region), m_left (nullptr), m_right(nullptr) { } 1051 explicit RegionTree(PageMemoryRegion* region) : m_region(region), m_left (nullptr), m_right(nullptr) { }
1046 ~RegionTree() 1052 ~RegionTree()
1047 { 1053 {
1048 delete m_left; 1054 delete m_left;
1049 delete m_right; 1055 delete m_right;
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after
1382 size_t copySize = previousHeader->payloadSize(); 1388 size_t copySize = previousHeader->payloadSize();
1383 if (copySize > size) 1389 if (copySize > size)
1384 copySize = size; 1390 copySize = size;
1385 memcpy(address, previous, copySize); 1391 memcpy(address, previous, copySize);
1386 return address; 1392 return address;
1387 } 1393 }
1388 1394
1389 } // namespace blink 1395 } // namespace blink
1390 1396
1391 #endif // Heap_h 1397 #endif // Heap_h
OLDNEW
« no previous file with comments | « no previous file | Source/platform/heap/Heap.cpp » ('j') | Source/platform/heap/Heap.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698