Lines Matching defs:chunk
280 // this way have be freed at once. Next function allocates a single chunk for linked list
286 _cmsSubAllocator_chunk* chunk;
293 chunk = (_cmsSubAllocator_chunk*) _cmsMallocZero(ContextID, sizeof(_cmsSubAllocator_chunk));
294 if (chunk == NULL) return NULL;
297 chunk ->Block = (cmsUInt8Number*) _cmsMalloc(ContextID, Initial);
298 if (chunk ->Block == NULL) {
301 _cmsFree(ContextID, chunk);
307 chunk ->BlockSize = Initial;
308 chunk ->Used = 0;
309 chunk ->next = NULL;
311 return chunk;
339 _cmsSubAllocator_chunk *chunk, *n;
341 for (chunk = sub ->h; chunk != NULL; chunk = n) {
343 n = chunk->next;
344 if (chunk->Block != NULL) _cmsFree(sub ->ContextID, chunk->Block);
345 _cmsFree(sub ->ContextID, chunk);
361 // Check for memory. If there is no room, allocate a new chunk of double memory size.
364 _cmsSubAllocator_chunk* chunk;
370 chunk = _cmsCreateSubAllocChunk(sub -> ContextID, newSize);
371 if (chunk == NULL) return NULL;
374 chunk ->next = sub ->h;
375 sub ->h = chunk;