| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef BlinkGC_h | 5 #ifndef BlinkGC_h |
| 6 #define BlinkGC_h | 6 #define BlinkGC_h |
| 7 | 7 |
| 8 // BlinkGC.h is a file that defines common things used by Blink GC. | 8 // BlinkGC.h is a file that defines common things used by Blink GC. |
| 9 | 9 |
| 10 #include "platform/PlatformExport.h" | 10 #include "platform/PlatformExport.h" |
| 11 #include "wtf/Allocator.h" | 11 #include "wtf/Allocator.h" |
| 12 | 12 |
| 13 namespace blink { | 13 namespace blink { |
| 14 | 14 |
| 15 class Visitor; | 15 class Visitor; |
| 16 | 16 |
| 17 #define PRINT_HEAP_STATS 0 // Enable this macro to print heap stats to stderr. | 17 #define PRINT_HEAP_STATS 0 // Enable this macro to print heap stats to stderr. |
| 18 | 18 |
| 19 using Address = uint8_t*; | 19 using Address = uint8_t*; |
| 20 | 20 |
| 21 using FinalizationCallback = void (*)(void*); | 21 using FinalizationCallback = void (*)(void*); |
| 22 using VisitorCallback = void (*)(Visitor*, void* self); | 22 using VisitorCallback = void (*)(Visitor*, void* self); |
| 23 using TraceCallback = VisitorCallback; | 23 using TraceCallback = VisitorCallback; |
| 24 using WeakCallback = VisitorCallback; | 24 using WeakCallback = VisitorCallback; |
| 25 using EphemeronCallback = VisitorCallback; | 25 using EphemeronCallback = VisitorCallback; |
| 26 using PreFinalizerCallback = bool (*)(void*); | |
| 27 | 26 |
| 28 // Simple alias to avoid heap compaction type signatures turning into | 27 // Simple alias to avoid heap compaction type signatures turning into |
| 29 // a sea of generic |void*|s. | 28 // a sea of generic |void*|s. |
| 30 using MovableReference = void*; | 29 using MovableReference = void*; |
| 31 | 30 |
| 32 // Heap compaction supports registering callbacks that are to be invoked | 31 // Heap compaction supports registering callbacks that are to be invoked |
| 33 // when an object is moved during compaction. This is to support internal | 32 // when an object is moved during compaction. This is to support internal |
| 34 // location fixups that need to happen as a result. | 33 // location fixups that need to happen as a result. |
| 35 // | 34 // |
| 36 // i.e., when the object residing at |from| is moved to |to| by the compaction | 35 // i.e., when the object residing at |from| is moved to |to| by the compaction |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 | 120 |
| 122 enum ThreadHeapMode { | 121 enum ThreadHeapMode { |
| 123 MainThreadHeapMode, | 122 MainThreadHeapMode, |
| 124 PerThreadHeapMode, | 123 PerThreadHeapMode, |
| 125 }; | 124 }; |
| 126 }; | 125 }; |
| 127 | 126 |
| 128 } // namespace blink | 127 } // namespace blink |
| 129 | 128 |
| 130 #endif | 129 #endif |
| OLD | NEW |