Flutter Engine
The Flutter Engine
Public Member Functions | List of all members
dart::AllocAndGCTask Class Reference
Inheritance diagram for dart::AllocAndGCTask:
dart::ThreadPool::Task dart::IntrusiveDListEntry< Task >

Public Member Functions

 AllocAndGCTask (IsolateGroup *isolate_group, Monitor *done_monitor, bool *done)
 
virtual void Run ()
 
- Public Member Functions inherited from dart::ThreadPool::Task
virtual ~Task ()
 
virtual void Run ()=0
 
- Public Member Functions inherited from dart::IntrusiveDListEntry< Task >
 IntrusiveDListEntry ()
 
 ~IntrusiveDListEntry ()
 

Additional Inherited Members

- Protected Member Functions inherited from dart::ThreadPool::Task
 Task ()
 

Detailed Description

Definition at line 853 of file thread_test.cc.

Constructor & Destructor Documentation

◆ AllocAndGCTask()

dart::AllocAndGCTask::AllocAndGCTask ( IsolateGroup isolate_group,
Monitor done_monitor,
bool *  done 
)
inline

Definition at line 855 of file thread_test.cc.

856 : isolate_group_(isolate_group),
857 done_monitor_(done_monitor),
858 done_(done) {}
static void done(const char *config, const char *src, const char *srcOptions, const char *name)
Definition: DM.cpp:263

Member Function Documentation

◆ Run()

virtual void dart::AllocAndGCTask::Run ( )
inlinevirtual

Implements dart::ThreadPool::Task.

Definition at line 860 of file thread_test.cc.

860 {
861 const bool kBypassSafepoint = false;
863 kBypassSafepoint);
864 {
865 Thread* thread = Thread::Current();
866 StackZone stack_zone(thread);
867 Zone* zone = stack_zone.GetZone();
868 String& old_str = String::Handle(zone, String::New("old", Heap::kOld));
869 isolate_group_->heap()->CollectAllGarbage();
870 EXPECT(old_str.Equals("old"));
871 }
872 Thread::ExitIsolateGroupAsHelper(kBypassSafepoint);
873 // Tell main thread that we are ready.
874 {
875 MonitorLocker ml(done_monitor_);
876 ASSERT(!*done_);
877 *done_ = true;
878 ml.Notify();
879 }
880 }
#define EXPECT(type, expectedAlignment, expectedSize)
@ kOld
Definition: heap.h:39
void CollectAllGarbage(GCReason reason=GCReason::kFull, bool compact=false)
Definition: heap.cc:573
Heap * heap() const
Definition: isolate.h:296
static Object & Handle()
Definition: object.h:407
static StringPtr New(const char *cstr, Heap::Space space=Heap::kNew)
Definition: object.cc:23698
@ kUnknownTask
Definition: thread.h:346
static Thread * Current()
Definition: thread.h:362
static void ExitIsolateGroupAsHelper(bool bypass_safepoint)
Definition: thread.cc:499
static bool EnterIsolateGroupAsHelper(IsolateGroup *isolate_group, TaskKind kind, bool bypass_safepoint)
Definition: thread.cc:481
#define ASSERT(E)

The documentation for this class was generated from the following file: