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

Public Member Functions

 AcquiredData (void *data, intptr_t size_in_bytes, bool copy)
 
void * GetData () const
 
 ~AcquiredData ()
 

Detailed Description

Definition at line 3995 of file dart_api_impl.cc.

Constructor & Destructor Documentation

◆ AcquiredData()

dart::AcquiredData::AcquiredData ( void *  data,
intptr_t  size_in_bytes,
bool  copy 
)
inline

Definition at line 3997 of file dart_api_impl.cc.

3998 : size_in_bytes_(size_in_bytes), data_(data), data_copy_(nullptr) {
3999 if (copy) {
4000 data_copy_ = malloc(size_in_bytes_);
4001 memmove(data_copy_, data_, size_in_bytes_);
4002 }
4003 }
Definition: copy.py:1
void * malloc(size_t size)
Definition: allocation.cc:19
static int8_t data[kExtLength]

◆ ~AcquiredData()

dart::AcquiredData::~AcquiredData ( )
inline

Definition at line 4009 of file dart_api_impl.cc.

4009 {
4010 if (data_copy_ != nullptr) {
4011 memmove(data_, data_copy_, size_in_bytes_);
4012 memset(data_copy_, kZapReleasedByte, size_in_bytes_);
4013 free(data_copy_);
4014 }
4015 }

Member Function Documentation

◆ GetData()

void * dart::AcquiredData::GetData ( ) const
inline

Definition at line 4006 of file dart_api_impl.cc.

4006{ return data_copy_ != nullptr ? data_copy_ : data_; }

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