Lines Matching refs:block
46 BlockHeader* block = CreateBlock(blockSize);
48 block->fPrev = fTail;
49 block->fNext = NULL;
51 fTail->fNext = block;
52 fTail = block;
56 // We stash a pointer to the block header, just before the allocated space,
72 BlockHeader* block = *reinterpret_cast<BlockHeader**>(ptr);
73 if (1 == block->fLiveCount) {
74 // the head block is special, it is reset rather than deleted
75 if (fHead == block) {
81 BlockHeader* prev = block->fPrev;
82 BlockHeader* next = block->fNext;
88 GrAssert(fTail == block);
91 DeleteBlock(block);
94 --block->fLiveCount;
96 if (block->fPrevPtr == ptr) {
97 block->fFreeSize += (block->fCurrPtr - block->fPrevPtr);
98 block->fCurrPtr = block->fPrevPtr;
106 BlockHeader* block =
109 GrAssert(!(reinterpret_cast<intptr_t>(block) % kAlignment));
110 block->fLiveCount = 0;
111 block->fFreeSize = size;
112 block->fCurrPtr = reinterpret_cast<intptr_t>(block) + kHeaderSize;
113 block->fPrevPtr = 0; // gcc warns on assigning NULL to an intptr_t.
114 return block;
117 void GrMemoryPool::DeleteBlock(BlockHeader* block) {
118 GrFree(block);
123 BlockHeader* block = fHead;
125 GrAssert(block);
128 allocCount += block->fLiveCount;
129 GrAssert(prev == block->fPrev);
131 GrAssert(prev->fNext == block);
134 intptr_t b = reinterpret_cast<intptr_t>(block);
135 size_t ptrOffset = block->fCurrPtr - b;
136 size_t totalSize = ptrOffset + block->fFreeSize;
143 GrAssert(!(block->fCurrPtr % kAlignment));
144 if (fHead != block) {
145 GrAssert(block->fLiveCount);
150 if (!block->fLiveCount) {
152 GrAssert(userStart == block->fCurrPtr);
154 GrAssert(block == *reinterpret_cast<BlockHeader**>(userStart));
156 prev = block;
157 } while ((block = block->fNext));