Lines Matching defs:Block
20 struct SkChunkAlloc::Block {
21 Block* fNext;
30 static void FreeChain(Block* block) {
31 while (block) {
32 Block* next = block->fNext;
33 sk_free(block);
34 block = next;
64 Block::FreeChain(fBlock);
72 SkChunkAlloc::Block* SkChunkAlloc::newBlock(size_t bytes, AllocFailType ftype) {
78 Block* block = (Block*)sk_malloc_flags(sizeof(Block) + size,
81 if (block) {
82 // block->fNext = fBlock;
83 block->fFreeSize = size;
84 block->fFreePtr = block->startOfData();
91 return block;
99 Block* block = fBlock;
101 if (block == NULL || bytes > block->fFreeSize) {
102 block = this->newBlock(bytes, ftype);
103 if (NULL == block) {
106 block->fNext = fBlock;
107 fBlock = block;
110 SkASSERT(block && bytes <= block->fFreeSize);
111 char* ptr = block->fFreePtr;
113 block->fFreeSize -= bytes;
114 block->fFreePtr = ptr + bytes;
120 Block* block = fBlock;
121 if (block) {
123 char* start = block->startOfData();
124 if (start <= cPtr && cPtr < block->fFreePtr) {
125 bytes = block->fFreePtr - cPtr;
126 block->fFreeSize += bytes;
127 block->fFreePtr = cPtr;
134 const Block* block = fBlock;
135 while (block) {
136 if (block->contains(addr)) {
139 block = block->fNext;