#include <unit_test_custom_zone.h>
|
| Zone () |
|
| ~Zone () |
|
template<class ElementType > |
ElementType * | Alloc (intptr_t length) |
|
template<class ElementType > |
ElementType * | Realloc (ElementType *old_array, intptr_t old_length, intptr_t new_length) |
|
template<class ElementType > |
void | Free (ElementType *old_array, intptr_t len) |
|
void * | AllocUnsafe (intptr_t size) |
|
template<class ElementType > |
ElementType * | Alloc (intptr_t len) |
|
template<class ElementType > |
ElementType * | Realloc (ElementType *old_array, intptr_t old_len, intptr_t new_len) |
|
uword | AllocUnsafe (intptr_t size) |
|
char * | MakeCopyOfString (const char *str) |
|
char * | MakeCopyOfStringN (const char *str, intptr_t len) |
|
char * | ConcatStrings (const char *a, const char *b, char join=',') |
|
char * | PrintToString (const char *format,...) PRINTF_ATTRIBUTE(2 |
|
char char * | VPrint (const char *format, va_list args) |
|
uintptr_t | SizeInBytes () const |
|
uintptr_t | CapacityInBytes () const |
|
void | Print () const |
|
VMHandles * | handles () |
|
void | VisitObjectPointers (ObjectPointerVisitor *visitor) |
|
Zone * | previous () const |
|
bool | ContainsNestedZone (Zone *other) const |
|
Definition at line 19 of file unit_test_custom_zone.h.
◆ Zone()
◆ ~Zone()
Definition at line 22 of file unit_test_custom_zone.cc.
22 {
23 while (buffers_.size() > 0) {
24 free(buffers_.back());
25 buffers_.pop_back();
26 }
27}
◆ Alloc() [1/2]
template<class ElementType >
ElementType * dart::Zone::Alloc |
( |
intptr_t |
len | ) |
|
|
inline |
◆ Alloc() [2/2]
template<class ElementType >
ElementType * dart::Zone::Alloc |
( |
intptr_t |
length | ) |
|
|
inline |
◆ AllocUnsafe() [1/2]
uword dart::Zone::AllocUnsafe |
( |
intptr_t |
size | ) |
|
|
inline |
Definition at line 29 of file unit_test_custom_zone.cc.
29 {
30 void* memory =
malloc(size);
31 buffers_.push_back(memory);
32 return memory;
33}
void * malloc(size_t size)
◆ AllocUnsafe() [2/2]
uword dart::Zone::AllocUnsafe |
( |
intptr_t |
size | ) |
|
|
inline |
◆ CapacityInBytes()
uintptr_t dart::Zone::CapacityInBytes |
( |
| ) |
const |
Definition at line 186 of file zone.cc.
186 {
187 uintptr_t
size = kInitialChunkSize;
188 for (Segment*
s = segments_;
s !=
nullptr;
s =
s->next()) {
190 }
192}
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
◆ Cleanup()
void dart::Zone::Cleanup |
( |
| ) |
|
|
static |
Definition at line 63 of file zone.cc.
63 {
67}
static Mutex * segment_cache_mutex
◆ ClearCache()
void dart::Zone::ClearCache |
( |
| ) |
|
|
static |
Definition at line 69 of file zone.cc.
69 {
75 }
76}
static intptr_t segment_cache_size
static VirtualMemory * segment_cache[kSegmentCacheCapacity]
static constexpr intptr_t kSegmentCacheCapacity
◆ ConcatStrings()
char * dart::Zone::ConcatStrings |
( |
const char * |
a, |
|
|
const char * |
b, |
|
|
char |
join = ',' |
|
) |
| |
Definition at line 291 of file zone.cc.
291 {
292 intptr_t a_len = (
a ==
nullptr) ? 0 : strlen(
a);
293 const intptr_t b_len = strlen(
b) + 1;
294 const intptr_t
len = a_len + b_len;
295 char*
copy = Alloc<char>(len);
296 if (a_len > 0) {
297 strncpy(
copy,
a, a_len);
298
300 }
301 strncpy(&
copy[a_len],
b, b_len);
303}
SINT Vec< 2 *N, T > join(const Vec< N, T > &lo, const Vec< N, T > &hi)
◆ ContainsNestedZone()
bool dart::Zone::ContainsNestedZone |
( |
Zone * |
other | ) |
const |
|
inline |
Definition at line 79 of file zone.h.
79 {
80 while (other != nullptr) {
81 if (this == other) return true;
82 other = other->previous_;
83 }
84 return false;
85 }
◆ Free()
template<class ElementType >
void dart::Zone::Free |
( |
ElementType * |
old_array, |
|
|
intptr_t |
len |
|
) |
| |
|
inline |
◆ handles()
◆ Init()
void dart::Zone::Init |
( |
| ) |
|
|
static |
Definition at line 58 of file zone.cc.
58 {
61}
#define NOT_IN_PRODUCT(code)
◆ MakeCopyOfString()
char * dart::Zone::MakeCopyOfString |
( |
const char * |
str | ) |
|
Definition at line 270 of file zone.cc.
270 {
271 intptr_t
len = strlen(str) + 1;
272 char*
copy = Alloc<char>(len);
273 strncpy(
copy, str, len);
275}
◆ MakeCopyOfStringN()
char * dart::Zone::MakeCopyOfStringN |
( |
const char * |
str, |
|
|
intptr_t |
len |
|
) |
| |
Definition at line 277 of file zone.cc.
277 {
279 for (intptr_t i = 0; i <
len; i++) {
280 if (str[i] == '\0') {
282 break;
283 }
284 }
285 char*
copy = Alloc<char>(len + 1);
286 strncpy(
copy, str, len);
289}
◆ previous()
Zone * dart::Zone::previous |
( |
| ) |
const |
|
inline |
◆ Print()
void dart::Zone::Print |
( |
| ) |
const |
Definition at line 194 of file zone.cc.
194 {
198 intptr_t
total_size = segment_size + scoped_handle_size + zone_handle_size;
200 ", zone_handles: %" Pd ", total: %" Pd ")\n",
201 this, segment_size, scoped_handle_size, zone_handle_size,
203}
static size_t total_size(SkSBlockAllocator< N > &pool)
intptr_t ZoneHandlesCapacityInBytes() const
intptr_t ScopedHandlesCapacityInBytes() const
static void static void PrintErr(const char *format,...) PRINTF_ATTRIBUTE(1
uintptr_t CapacityInBytes() const
◆ PrintToString()
char * dart::Zone::PrintToString |
( |
const char * |
format, |
|
|
|
... |
|
) |
| |
Definition at line 313 of file zone.cc.
313 {
319}
static char static char * VSCreate(Zone *zone, const char *format, va_list args)
G_BEGIN_DECLS G_MODULE_EXPORT FlValue * args
static const uint8_t buffer[]
uint32_t uint32_t * format
◆ Realloc() [1/2]
template<class ElementType >
ElementType * dart::Zone::Realloc |
( |
ElementType * |
old_array, |
|
|
intptr_t |
old_len, |
|
|
intptr_t |
new_len |
|
) |
| |
|
inline |
◆ Realloc() [2/2]
template<class ElementType >
ElementType * dart::Zone::Realloc |
( |
ElementType * |
old_array, |
|
|
intptr_t |
old_length, |
|
|
intptr_t |
new_length |
|
) |
| |
|
inline |
Definition at line 30 of file unit_test_custom_zone.h.
32 {
33 void* memory =
AllocUnsafe(
sizeof(ElementType) * new_length);
34 memmove(memory, old_array, sizeof(ElementType) * old_length);
35 return static_cast<ElementType*>(memory);
36 }
◆ Size()
static intptr_t dart::Zone::Size |
( |
| ) |
|
|
inlinestatic |
Definition at line 94 of file zone.h.
94{ return total_size_; }
◆ SizeInBytes()
uintptr_t dart::Zone::SizeInBytes |
( |
| ) |
const |
Definition at line 182 of file zone.cc.
182 {
183 return size_;
184}
◆ VisitObjectPointers()
Definition at line 305 of file zone.cc.
305 {
307 while (zone != nullptr) {
308 zone->handles()->VisitObjectPointers(visitor);
309 zone = zone->previous_;
310 }
311}
◆ VPrint()
char * dart::Zone::VPrint |
( |
const char * |
format, |
|
|
va_list |
args |
|
) |
| |
◆ AllocOnlyStackZone
◆ ApiZone
◆ BaseDirectChainedHashMap
template<typename
T , typename
B , typename
Allocator >
◆ BaseGrowableArray
template<typename
T , typename
B , typename
Allocator >
◆ StackZone
◆ kAlignment
constexpr intptr_t dart::Zone::kAlignment = kDoubleSize |
|
staticconstexpr |
The documentation for this class was generated from the following files: