Lines Matching refs:size
38 if (chunk->ptr == (pool->arena + (pool->arena_size - pool->free_size - chunk->size))) { in mysqlnd_mempool_free_chunk()
43 pool->free_size += chunk->size; in mysqlnd_mempool_free_chunk()
57 mysqlnd_mempool_resize_chunk(MYSQLND_MEMORY_POOL_CHUNK * chunk, unsigned int size TSRMLS_DC) in mysqlnd_mempool_resize_chunk()
63 if (chunk->ptr == (pool->arena + (pool->arena_size - pool->free_size - chunk->size))) { in mysqlnd_mempool_resize_chunk()
68 if ((chunk->size + pool->free_size) < size) { in mysqlnd_mempool_resize_chunk()
70 new_ptr = mnd_malloc(size); in mysqlnd_mempool_resize_chunk()
74 memcpy(new_ptr, chunk->ptr, chunk->size); in mysqlnd_mempool_resize_chunk()
76 pool->free_size += chunk->size; in mysqlnd_mempool_resize_chunk()
77 chunk->size = size; in mysqlnd_mempool_resize_chunk()
82 pool->free_size += (chunk->size - size); in mysqlnd_mempool_resize_chunk()
86 if (chunk->size >= size) { in mysqlnd_mempool_resize_chunk()
90 new_ptr = mnd_malloc(size); in mysqlnd_mempool_resize_chunk()
94 memcpy(new_ptr, chunk->ptr, chunk->size); in mysqlnd_mempool_resize_chunk()
96 chunk->size = size; in mysqlnd_mempool_resize_chunk()
102 zend_uchar *new_ptr = mnd_realloc(chunk->ptr, size); in mysqlnd_mempool_resize_chunk()
115 MYSQLND_MEMORY_POOL_CHUNK * mysqlnd_mempool_get_chunk(MYSQLND_MEMORY_POOL * pool, unsigned int size… in mysqlnd_mempool_get_chunk()
124 chunk->size = size; in mysqlnd_mempool_get_chunk()
131 if (size > pool->free_size) { in mysqlnd_mempool_get_chunk()
133 chunk->ptr = mnd_malloc(size); in mysqlnd_mempool_get_chunk()
143 pool->free_size -= size; in mysqlnd_mempool_get_chunk()