Flutter Engine
The Flutter Engine
Classes | Functions | Variables
skjson Namespace Reference

Classes

class  ArrayValue
 
class  BoolValue
 
class  DOM
 
struct  Member
 
class  NullValue
 
class  NumberValue
 
class  ObjectValue
 
class  StringValue
 
class  Value
 
class  VectorValue
 

Functions

template<typename T , size_t extra_alloc_size = 0>
static void * MakeVector (size_t vec_size, const void *src, size_t src_size, SkArenaAlloc &alloc)
 
template<typename T , size_t extra_alloc_size = 0>
static void * MakeVector (size_t vec_size, const void *src, SkArenaAlloc &alloc)
 
static int inline_strcmp (const char a[], const char b[])
 

Variables

static constexpr size_t kRecAlign = alignof(Value)
 
static constexpr size_t kMinChunkSize = 4096
 

Function Documentation

◆ inline_strcmp()

static int skjson::inline_strcmp ( const char  a[],
const char  b[] 
)
static

Definition at line 216 of file SkJSON.cpp.

216 {
217 for (;;) {
218 char c = *a++;
219 if (c == 0) {
220 break;
221 }
222 if (c != *b++) {
223 return 1;
224 }
225 }
226 return *b != 0;
227}
static bool b
struct MyStruct a[10]

◆ MakeVector() [1/2]

template<typename T , size_t extra_alloc_size = 0>
static void * skjson::MakeVector ( size_t  vec_size,
const void *  src,
size_t  src_size,
SkArenaAlloc alloc 
)
static

Definition at line 92 of file SkJSON.cpp.

92 {
93 // The Ts are already in memory, so their size should be safe.
94 const auto total_size = sizeof(size_t) + vec_size * sizeof(T) + extra_alloc_size;
95 auto* size_ptr = reinterpret_cast<size_t*>(alloc.makeBytesAlignedTo(total_size, kRecAlign));
96
97 *size_ptr = vec_size;
98 sk_careful_memcpy(size_ptr + 1, src, src_size * sizeof(T));
99
100 return size_ptr;
101}
static size_t total_size(SkSBlockAllocator< N > &pool)
static void * sk_careful_memcpy(void *dst, const void *src, size_t len)
Definition: SkMalloc.h:125
void * makeBytesAlignedTo(size_t size, size_t align)
Definition: SkArenaAlloc.h:200
static constexpr size_t kRecAlign
Definition: SkJSON.cpp:36
#define T
Definition: precompiler.cc:65

◆ MakeVector() [2/2]

template<typename T , size_t extra_alloc_size = 0>
static void * skjson::MakeVector ( size_t  vec_size,
const void *  src,
SkArenaAlloc alloc 
)
static

Definition at line 104 of file SkJSON.cpp.

104 {
105 return MakeVector<T, extra_alloc_size>(vec_size, src, vec_size, alloc);
106}

Variable Documentation

◆ kMinChunkSize

constexpr size_t skjson::kMinChunkSize = 4096
staticconstexpr

Definition at line 946 of file SkJSON.cpp.

◆ kRecAlign

constexpr size_t skjson::kRecAlign = alignof(Value)
staticconstexpr

Definition at line 36 of file SkJSON.cpp.