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

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

Issue 1609943003: Make platform/heap to use USING_FAST_MALLOC. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed compile error Created 4 years, 11 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 // 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 BlinkGCInterruptor_h 5 #ifndef BlinkGCInterruptor_h
6 #define BlinkGCInterruptor_h 6 #define BlinkGCInterruptor_h
7 7
8 #include "platform/PlatformExport.h" 8 #include "platform/PlatformExport.h"
9 #include "wtf/Allocator.h"
9 10
10 namespace blink { 11 namespace blink {
11 12
12 // If attached thread enters long running loop that can call back 13 // If attached thread enters long running loop that can call back
13 // into Blink and leaving and reentering safepoint at every 14 // into Blink and leaving and reentering safepoint at every
14 // transition between this loop and Blink is deemed too expensive 15 // transition between this loop and Blink is deemed too expensive
15 // then instead of marking this loop as a GC safepoint thread 16 // then instead of marking this loop as a GC safepoint thread
16 // can provide an interruptor object which would allow GC 17 // can provide an interruptor object which would allow GC
17 // to temporarily interrupt and pause this long running loop at 18 // to temporarily interrupt and pause this long running loop at
18 // an arbitrary moment creating a safepoint for a GC. 19 // an arbitrary moment creating a safepoint for a GC.
19 class PLATFORM_EXPORT BlinkGCInterruptor { 20 class PLATFORM_EXPORT BlinkGCInterruptor {
21 USING_FAST_MALLOC(BlinkGCInterruptor);
20 public: 22 public:
21 virtual ~BlinkGCInterruptor() { } 23 virtual ~BlinkGCInterruptor() { }
22 24
23 // Request the interruptor to interrupt the thread and 25 // Request the interruptor to interrupt the thread and
24 // call onInterrupted on that thread once interruption 26 // call onInterrupted on that thread once interruption
25 // succeeds. 27 // succeeds.
26 virtual void requestInterrupt() = 0; 28 virtual void requestInterrupt() = 0;
27 29
28 protected: 30 protected:
29 // This method is called on the interrupted thread to 31 // This method is called on the interrupted thread to
30 // create a safepoint for a GC. 32 // create a safepoint for a GC.
31 void onInterrupted(); 33 void onInterrupted();
32 }; 34 };
33 35
34 } // namespace blink 36 } // namespace blink
35 37
36 #endif 38 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698