Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Classes | Public Member Functions | Protected Member Functions | Static Protected Attributes | List of all members
dart::bin::BufferListBase Class Reference

#include <process.h>

Classes

class  BufferListNode
 

Public Member Functions

 BufferListBase ()
 
 ~BufferListBase ()
 
Dart_Handle GetData ()
 

Protected Member Functions

bool Allocate ()
 
void Free ()
 
uint8_t * FreeSpaceAddress ()
 
intptr_t data_size () const
 
void set_data_size (intptr_t size)
 
intptr_t free_size () const
 
void set_free_size (intptr_t size)
 
BufferListNodehead () const
 
BufferListNodetail () const
 

Static Protected Attributes

static constexpr intptr_t kBufferSize = 16 * 1024
 

Detailed Description

Definition at line 226 of file process.h.

Constructor & Destructor Documentation

◆ BufferListBase()

dart::bin::BufferListBase::BufferListBase ( )
inline

Definition at line 254 of file process.h.

255 : head_(nullptr), tail_(nullptr), data_size_(0), free_size_(0) {}

◆ ~BufferListBase()

dart::bin::BufferListBase::~BufferListBase ( )
inline

Definition at line 256 of file process.h.

256 {
257 Free();
258 DEBUG_ASSERT(IsEmpty());
259 }
#define DEBUG_ASSERT(cond)
Definition assert.h:321

Member Function Documentation

◆ Allocate()

bool dart::bin::BufferListBase::Allocate ( )
inlineprotected

Definition at line 291 of file process.h.

291 {
292 ASSERT(free_size_ == 0);
293 BufferListNode* node = new BufferListNode(kBufferSize);
294 if ((node == nullptr) || !node->Valid()) {
295 // Failed to allocate a buffer for the node.
296 delete node;
297 return false;
298 }
299 if (head_ == nullptr) {
300 head_ = node;
301 tail_ = node;
302 } else {
303 ASSERT(tail_->next() == nullptr);
304 tail_->set_next(node);
305 tail_ = node;
306 }
307 free_size_ = kBufferSize;
308 return true;
309 }
void set_next(BufferListNode *n)
Definition process.h:244
BufferListNode * next() const
Definition process.h:243
static constexpr intptr_t kBufferSize
Definition process.h:228
#define ASSERT(E)

◆ data_size()

intptr_t dart::bin::BufferListBase::data_size ( ) const
inlineprotected

Definition at line 329 of file process.h.

329{ return data_size_; }

◆ Free()

void dart::bin::BufferListBase::Free ( )
inlineprotected

Definition at line 311 of file process.h.

311 {
312 BufferListNode* current = head_;
313 while (current != nullptr) {
314 BufferListNode* tmp = current;
315 current = current->next();
316 delete tmp;
317 }
318 head_ = nullptr;
319 tail_ = nullptr;
320 data_size_ = 0;
321 free_size_ = 0;
322 }

◆ free_size()

intptr_t dart::bin::BufferListBase::free_size ( ) const
inlineprotected

Definition at line 332 of file process.h.

332{ return free_size_; }

◆ FreeSpaceAddress()

uint8_t * dart::bin::BufferListBase::FreeSpaceAddress ( )
inlineprotected

Definition at line 325 of file process.h.

325 {
326 return tail_->data() + (kBufferSize - free_size_);
327 }

◆ GetData()

Dart_Handle dart::bin::BufferListBase::GetData ( )
inline

Definition at line 263 of file process.h.

263 {
264 uint8_t* buffer;
265 intptr_t buffer_position = 0;
267 if (Dart_IsNull(result)) {
269 }
270 if (Dart_IsError(result)) {
271 Free();
272 return result;
273 }
274 for (BufferListNode* current = head_; current != nullptr;
275 current = current->next()) {
276 intptr_t to_copy = dart::Utils::Minimum(data_size_, kBufferSize);
277 memmove(buffer + buffer_position, current->data(), to_copy);
278 buffer_position += to_copy;
279 data_size_ -= to_copy;
280 }
281 ASSERT(data_size_ == 0);
282 Free();
283 return result;
284 }
static T Minimum(T x, T y)
Definition utils.h:21
static Dart_Handle NewDartOSError()
Definition dartutils.cc:706
static Dart_Handle Allocate(intptr_t size, uint8_t **buffer)
Definition io_buffer.cc:12
struct _Dart_Handle * Dart_Handle
Definition dart_api.h:258
static const uint8_t buffer[]
GAsyncResult * result
dict to_copy
Definition create.py:30
DART_EXPORT bool Dart_IsError(Dart_Handle handle)
DART_EXPORT bool Dart_IsNull(Dart_Handle object)

◆ head()

BufferListNode * dart::bin::BufferListBase::head ( ) const
inlineprotected

Definition at line 335 of file process.h.

335{ return head_; }

◆ set_data_size()

void dart::bin::BufferListBase::set_data_size ( intptr_t  size)
inlineprotected

Definition at line 330 of file process.h.

330{ data_size_ = size; }
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap size
Definition switches.h:259

◆ set_free_size()

void dart::bin::BufferListBase::set_free_size ( intptr_t  size)
inlineprotected

Definition at line 333 of file process.h.

333{ free_size_ = size; }

◆ tail()

BufferListNode * dart::bin::BufferListBase::tail ( ) const
inlineprotected

Definition at line 336 of file process.h.

336{ return tail_; }

Member Data Documentation

◆ kBufferSize

constexpr intptr_t dart::bin::BufferListBase::kBufferSize = 16 * 1024
staticconstexprprotected

Definition at line 228 of file process.h.


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