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;
63 Block::FreeChain(fBlock);
70 SkChunkAlloc::Block* SkChunkAlloc::newBlock(size_t bytes, AllocFailType ftype) {
76 Block* block = (Block*)sk_malloc_flags(sizeof(Block) + size,
79 if (block) {
80 // block->fNext = fBlock;
81 block->fFreeSize = size;
82 block->fFreePtr = block->startOfData();
89 return block;
95 Block* block = fBlock;
97 if (block == NULL || bytes > block->fFreeSize) {
98 block = this->newBlock(bytes, ftype);
99 if (NULL == block) {
102 block->fNext = fBlock;
103 fBlock = block;
106 SkASSERT(block && bytes <= block->fFreeSize);
107 char* ptr = block->fFreePtr;
109 block->fFreeSize -= bytes;
110 block->fFreePtr = ptr + bytes;
116 Block* block = fBlock;
117 if (block) {
119 char* start = block->startOfData();
120 if (start <= cPtr && cPtr < block->fFreePtr) {
121 bytes = block->fFreePtr - cPtr;
122 block->fFreeSize += bytes;
123 block->fFreePtr = cPtr;
130 const Block* block = fBlock;
131 while (block) {
132 if (block->contains(addr)) {
135 block = block->fNext;