| 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 1019 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |