Flutter Engine
The Flutter Engine
Public Member Functions | List of all members
dart::GCLinkedList< Type, PtrType > Class Template Reference

#include <gc_shared.h>

Public Member Functions

void Enqueue (PtrType ptr)
 
void FlushInto (GCLinkedList< Type, PtrType > *to)
 
PtrType Release ()
 
bool IsEmpty ()
 

Detailed Description

template<typename Type, typename PtrType>
class dart::GCLinkedList< Type, PtrType >

Definition at line 38 of file gc_shared.h.

Member Function Documentation

◆ Enqueue()

template<typename Type , typename PtrType >
void dart::GCLinkedList< Type, PtrType >::Enqueue ( PtrType  ptr)
inline

Definition at line 40 of file gc_shared.h.

40 {
41 ASSERT(ptr->untag()->next_seen_by_gc().IsRawNull());
42 ptr->untag()->next_seen_by_gc_ = head_;
43 if (head_ == Type::null()) {
44 tail_ = ptr;
45 }
46 head_ = ptr;
47 }
static ObjectPtr null()
Definition: object.h:433
#define ASSERT(E)

◆ FlushInto()

template<typename Type , typename PtrType >
void dart::GCLinkedList< Type, PtrType >::FlushInto ( GCLinkedList< Type, PtrType > *  to)
inline

Definition at line 49 of file gc_shared.h.

49 {
50 if (to->head_ == Type::null()) {
51 ASSERT(to->tail_ == Type::null());
52 to->head_ = head_;
53 to->tail_ = tail_;
54 } else {
55 ASSERT(to->tail_ != Type::null());
56 ASSERT(to->tail_->untag()->next_seen_by_gc() == Type::null());
57 if (head_ != Type::null()) {
58 to->tail_->untag()->next_seen_by_gc_ = head_;
59 to->tail_ = tail_;
60 }
61 }
62 Release();
63 }
PtrType Release()
Definition: gc_shared.h:65

◆ IsEmpty()

template<typename Type , typename PtrType >
bool dart::GCLinkedList< Type, PtrType >::IsEmpty ( )
inline

Definition at line 72 of file gc_shared.h.

72{ return head_ == Type::null() && tail_ == Type::null(); }

◆ Release()

template<typename Type , typename PtrType >
PtrType dart::GCLinkedList< Type, PtrType >::Release ( )
inline

Definition at line 65 of file gc_shared.h.

65 {
66 PtrType return_value = head_;
67 head_ = Type::null();
68 tail_ = Type::null();
69 return return_value;
70 }

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