Flutter Engine
The Flutter Engine
Public Member Functions | List of all members
dart::FinalizablePersistentHandles Class Reference

#include <dart_api_state.h>

Inheritance diagram for dart::FinalizablePersistentHandles:
dart::Handles< kFinalizablePersistentHandleSizeInWords, kFinalizablePersistentHandlesPerChunk, kOffsetOfRawPtrInFinalizablePersistentHandle >

Public Member Functions

 FinalizablePersistentHandles ()
 
 ~FinalizablePersistentHandles ()
 
FinalizablePersistentHandlefree_list () const
 
void set_free_list (FinalizablePersistentHandle *value)
 
void VisitHandles (HandleVisitor *visitor)
 
void VisitObjectPointers (ObjectPointerVisitor *visitor)
 
FinalizablePersistentHandleAllocateHandle ()
 
void ClearHandle (FinalizablePersistentHandle *handle)
 
void FreeHandle (FinalizablePersistentHandle *handle)
 
bool IsValidHandle (Dart_WeakPersistentHandle object) const
 
bool IsValidHandle (Dart_FinalizableHandle object) const
 
bool IsFreeHandle (Dart_WeakPersistentHandle object) const
 
int CountHandles () const
 

Detailed Description

Definition at line 517 of file dart_api_state.h.

Constructor & Destructor Documentation

◆ FinalizablePersistentHandles()

dart::FinalizablePersistentHandles::FinalizablePersistentHandles ( )
inline

◆ ~FinalizablePersistentHandles()

dart::FinalizablePersistentHandles::~FinalizablePersistentHandles ( )
inline

Definition at line 527 of file dart_api_state.h.

527{ free_list_ = nullptr; }

Member Function Documentation

◆ AllocateHandle()

FinalizablePersistentHandle * dart::FinalizablePersistentHandles::AllocateHandle ( )
inline

Definition at line 552 of file dart_api_state.h.

552 {
553 FinalizablePersistentHandle* handle;
554 if (free_list_ != nullptr) {
555 handle = free_list_;
556 free_list_ = handle->Next();
557 handle->set_ptr(Object::null());
558 return handle;
559 }
560
561 handle =
562 reinterpret_cast<FinalizablePersistentHandle*>(AllocateScopedHandle());
563 handle->Clear();
564 return handle;
565 }
static ObjectPtr null()
Definition: object.h:433

◆ ClearHandle()

void dart::FinalizablePersistentHandles::ClearHandle ( FinalizablePersistentHandle handle)
inline

Definition at line 567 of file dart_api_state.h.

567 {
568 handle->Clear();
569 handle->SetFinalizedNotFreed();
570 }

◆ CountHandles()

int dart::FinalizablePersistentHandles::CountHandles ( ) const
inline

◆ free_list()

FinalizablePersistentHandle * dart::FinalizablePersistentHandles::free_list ( ) const
inline

Definition at line 530 of file dart_api_state.h.

530{ return free_list_; }

◆ FreeHandle()

void dart::FinalizablePersistentHandles::FreeHandle ( FinalizablePersistentHandle handle)
inline

Definition at line 572 of file dart_api_state.h.

572 {
573 handle->FreeHandle(free_list());
574 set_free_list(handle);
575 }
void set_free_list(FinalizablePersistentHandle *value)
FinalizablePersistentHandle * free_list() const

◆ IsFreeHandle()

bool dart::FinalizablePersistentHandles::IsFreeHandle ( Dart_WeakPersistentHandle  object) const
inline

Definition at line 586 of file dart_api_state.h.

586 {
587 FinalizablePersistentHandle* handle = free_list_;
588 while (handle != nullptr) {
589 if (handle == reinterpret_cast<FinalizablePersistentHandle*>(object)) {
590 return true;
591 }
592 handle = handle->Next();
593 }
594 return false;
595 }

◆ IsValidHandle() [1/2]

bool dart::FinalizablePersistentHandles::IsValidHandle ( Dart_FinalizableHandle  object) const
inline

Definition at line 582 of file dart_api_state.h.

◆ IsValidHandle() [2/2]

bool dart::FinalizablePersistentHandles::IsValidHandle ( Dart_WeakPersistentHandle  object) const
inline

Definition at line 578 of file dart_api_state.h.

578 {
579 return IsValidScopedHandle(reinterpret_cast<uword>(object));
580 }

◆ set_free_list()

void dart::FinalizablePersistentHandles::set_free_list ( FinalizablePersistentHandle value)
inline

Definition at line 531 of file dart_api_state.h.

531{ free_list_ = value; }
uint8_t value

◆ VisitHandles()

void dart::FinalizablePersistentHandles::VisitHandles ( HandleVisitor visitor)
inline

◆ VisitObjectPointers()

void dart::FinalizablePersistentHandles::VisitObjectPointers ( ObjectPointerVisitor visitor)
inline

Definition at line 541 of file dart_api_state.h.

541 {
542 visitor->set_gc_root_type("weak persistent handle");
546 VisitObjectPointers(visitor);
547 visitor->clear_gc_root_type();
548 }
void VisitObjectPointers(ObjectPointerVisitor *visitor)

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