third_party/cairo/src/cairo-tor22-scan-converter.c
static void *
_pool_alloc_from_new_chunk(
    struct pool *pool,
    size_t size)
{
    struct _pool_chunk *chunk;
    void *obj;
    size_t capacity;

    /* If the allocation is smaller than the default chunk size then
     * try getting a chunk off the free list.  Force alloc of a new
     * chunk for large requests. */
    capacity = size;
    chunk = NULL;
    if (size < pool->default_capacity) {
	capacity = pool->default_capacity;
	chunk = pool->first_free;
	if (chunk) {
	    pool->first_free = chunk->prev_chunk;
	    _pool_chunk_init(chunk, pool->current, chunk->capacity);
	}
    }

    if (NULL == chunk)
	chunk = _pool_chunk_create (pool, capacity);
    pool->current = chunk;

    obj = ((unsigned char*)chunk + sizeof(*chunk) + chunk->size);
    chunk->size += size;
    return obj;
}
/* Satisfy an allocation by first allocating a new large enough chunk
 * and adding it to the head of the pool's chunk list. This function
 * is called as a fallback if pool_alloc() couldn't do a quick
 * allocation from the current chunk in the pool. */
Satisfy an allocation by first allocating a new large enough chunk
and adding it to the head of the pool's chunk list. This function
is called as a fallback if pool_alloc() couldn't do a quick
allocation from the current chunk in the pool.
Satisfy an allocation by first allocating a new large enough chunk and adding it to the head of the pool ' s chunk list . This function is called as a fallback if pool_alloc () couldn ' t do a quick allocation from the current chunk in the pool .
static void *
_pool_alloc_from_new_chunk(
    struct pool *pool,
    size_t size)
{
    struct _pool_chunk *chunk;
    void *obj;
    size_t capacity;
    capacity = size;
    chunk = NULL;
    if (size < pool->default_capacity) {
	capacity = pool->default_capacity;
	chunk = pool->first_free;
	if (chunk) {
	    pool->first_free = chunk->prev_chunk;
	    _pool_chunk_init(chunk, pool->current, chunk->capacity);
	}
    }
    if (NULL == chunk)
	chunk = _pool_chunk_create (pool, capacity);
    pool->current = chunk;
    obj = ((unsigned char*)chunk + sizeof(*chunk) + chunk->size);
    chunk->size += size;
    return obj;
}
static void * _pool_alloc_from_new_chunk ( struct pool * pool , size_t size ) { struct _pool_chunk * chunk ; void * obj ; size_t capacity ; capacity = size ; chunk = NULL ; if ( size < pool -> default_capacity ) { capacity = pool -> default_capacity ; chunk = pool -> first_free ; if ( chunk ) { pool -> first_free = chunk -> prev_chunk ; _pool_chunk_init ( chunk , pool -> current , chunk -> capacity ) ; } } if ( NULL == chunk ) chunk = _pool_chunk_create ( pool , capacity ) ; pool -> current = chunk ; obj = ( ( unsigned char * ) chunk + sizeof ( * chunk ) + chunk -> size ) ; chunk -> size += size ; return obj ; }
Satisfy an allocation by first allocating a new large enough chunk
 and adding it to the head of the pool's chunk list.
Satisfy an allocation by first allocating a new large enough chunk and adding it to the head of the pool ' s chunk list .
/* If the allocation is smaller than the default chunk size then
     * try getting a chunk off the free list.  Force alloc of a new
     * chunk for large requests. */