Lines Matching refs:size
34 if (chunk->ptr == (pool->arena + (pool->arena_size - pool->free_size - chunk->size))) { in mysqlnd_mempool_free_chunk()
39 pool->free_size += chunk->size; in mysqlnd_mempool_free_chunk()
52 …pool_resize_chunk(MYSQLND_MEMORY_POOL * pool, MYSQLND_MEMORY_POOL_CHUNK * chunk, unsigned int size) in mysqlnd_mempool_resize_chunk() argument
57 if (chunk->ptr == (pool->arena + (pool->arena_size - pool->free_size - chunk->size))) { in mysqlnd_mempool_resize_chunk()
62 if ((chunk->size + pool->free_size) < size) { in mysqlnd_mempool_resize_chunk()
64 new_ptr = mnd_emalloc(size); in mysqlnd_mempool_resize_chunk()
68 memcpy(new_ptr, chunk->ptr, chunk->size); in mysqlnd_mempool_resize_chunk()
70 pool->free_size += chunk->size; in mysqlnd_mempool_resize_chunk()
71 chunk->size = size; in mysqlnd_mempool_resize_chunk()
75 pool->free_size += (chunk->size - size); in mysqlnd_mempool_resize_chunk()
79 if (chunk->size >= size) { in mysqlnd_mempool_resize_chunk()
83 new_ptr = mnd_emalloc(size); in mysqlnd_mempool_resize_chunk()
87 memcpy(new_ptr, chunk->ptr, chunk->size); in mysqlnd_mempool_resize_chunk()
89 chunk->size = size; in mysqlnd_mempool_resize_chunk()
94 zend_uchar *new_ptr = mnd_erealloc(chunk->ptr, size); in mysqlnd_mempool_resize_chunk()
107 MYSQLND_MEMORY_POOL_CHUNK * mysqlnd_mempool_get_chunk(MYSQLND_MEMORY_POOL * pool, unsigned int size) in mysqlnd_mempool_get_chunk() argument
114 chunk->size = size; in mysqlnd_mempool_get_chunk()
120 if (size > pool->free_size) { in mysqlnd_mempool_get_chunk()
122 chunk->ptr = mnd_emalloc(size); in mysqlnd_mempool_get_chunk()
131 pool->free_size -= size; in mysqlnd_mempool_get_chunk()