21 : fFibProgression(
size, firstHeapAllocation) {
25 std::size_t space =
size;
27 if (bytes && std::align(kMaxAlignment,
sizeof(
Block), ptr, space)) {
28 this->setupBytesAndCapacity(bytes,
size);
29 new (fEndByte)
Block(
nullptr,
nullptr);
34 :
BagOfBytes(nullptr, 0, firstHeapAllocation) {}
37 Block* cursor =
reinterpret_cast<Block*
>(fEndByte);
38 while (cursor !=
nullptr) {
39 char* toDelete = cursor->fBlockStart;
40 cursor = cursor->fPrevious;
46 : fBlockStart{startOfBlock}
47 , fPrevious{reinterpret_cast<
Block*>(previous)} {}
54 return this->allocateBytes(
size, alignment);
57void BagOfBytes::setupBytesAndCapacity(
char* bytes,
int size) {
60 intptr_t endByte =
reinterpret_cast<intptr_t
>(bytes +
size -
sizeof(
Block)) & -kMaxAlignment;
61 fEndByte =
reinterpret_cast<char*
>(endByte);
62 fCapacity = fEndByte - bytes;
65void BagOfBytes::needMoreBytes(
int requestedSize,
int alignment) {
68 std::max(requestedSize, nextBlockSize), kAllocationAlignment);
69 char*
const bytes =
new char[
size];
71 char*
const previousBlock = fEndByte;
72 this->setupBytesAndCapacity(bytes,
size);
75 new (fEndByte)
Block{previousBlock, bytes};
78 fCapacity = fCapacity & -alignment;
79 SkASSERT(fCapacity >= requestedSize);
84 : fAlloc{bytes,
SkTo<size_t>(
size),
SkTo<size_t>(firstHeapAllocation)} {
#define SkASSERT_RELEASE(cond)
SkBlockAllocator::Block Block
constexpr bool SkIsPow2(T value)
void * alignedBytes(int unsafeSize, int unsafeAlignment)
BagOfBytes(char *block, size_t blockSize, size_t firstHeapAllocation)
static constexpr int PlatformMinimumSizeWithOverhead(int requestedSize, int assumedAlignment)
void * alignedBytes(int size, int alignment)
SubRunAllocator(char *block, int blockSize, int firstHeapAllocation)
static float max(float r, float g, float b)
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