Lines Matching refs:capacity
15 static inline void ds_vector_reallocate(ds_vector_t *vector, zend_long capacity) in ds_vector_reallocate() argument
17 …vector->buffer = ds_reallocate_zval_buffer(vector->buffer, capacity, vector->capacity, vector->s… in ds_vector_reallocate()
18 vector->capacity = capacity; in ds_vector_reallocate()
21 ds_vector_t *ds_vector_ex(zend_long capacity) in ds_vector_ex() argument
26 capacity = MAX(capacity, DS_VECTOR_MIN_CAPACITY); in ds_vector_ex()
28 vector->buffer = ds_allocate_zval_buffer(capacity); in ds_vector_ex()
29 vector->capacity = capacity; in ds_vector_ex()
48 clone->buffer = ds_allocate_zval_buffer(vector->capacity); in ds_vector_clone()
49 clone->capacity = vector->capacity; in ds_vector_clone()
57 ds_vector_t *ds_vector_from_buffer(zval *buffer, zend_long capacity, zend_long size) in ds_vector_from_buffer() argument
62 if (capacity < DS_VECTOR_MIN_CAPACITY) { in ds_vector_from_buffer()
63 buffer = ds_reallocate_zval_buffer(buffer, DS_VECTOR_MIN_CAPACITY, capacity, size); in ds_vector_from_buffer()
64 capacity = DS_VECTOR_MIN_CAPACITY; in ds_vector_from_buffer()
68 vector->capacity = capacity; in ds_vector_from_buffer()
74 void ds_vector_allocate(ds_vector_t *vector, zend_long capacity) in ds_vector_allocate() argument
76 if (capacity > vector->capacity) { in ds_vector_allocate()
77 ds_vector_reallocate(vector, capacity); in ds_vector_allocate()
83 ds_vector_reallocate(vector, vector->capacity + (vector->capacity >> 1)); in ds_vector_increase_capacity()
86 static inline void ds_vector_ensure_capacity(ds_vector_t *vector, zend_long capacity) in ds_vector_ensure_capacity() argument
88 if (capacity > vector->capacity) { in ds_vector_ensure_capacity()
89 zend_long boundary = vector->capacity + (vector->capacity >> 1); in ds_vector_ensure_capacity()
90 ds_vector_reallocate(vector, MAX(capacity, boundary)); in ds_vector_ensure_capacity()
96 const zend_long c = vector->capacity; in ds_vector_auto_truncate()
142 if (vector->size == vector->capacity) { in increase_capacity_if_full()
164 if (vector->capacity > DS_VECTOR_MIN_CAPACITY) { in ds_vector_clear()
519 zval *buffer = ds_allocate_zval_buffer(vector->capacity); in ds_vector_reversed()
527 return ds_vector_from_buffer(buffer, vector->capacity, vector->size); in ds_vector_reversed()
554 zval *buffer = ds_allocate_zval_buffer(vector->capacity); in ds_vector_map()
579 return ds_vector_from_buffer(buffer, vector->capacity, vector->size); in ds_vector_map()
685 zend_long capacity = MAX(length, DS_VECTOR_MIN_CAPACITY); in ds_vector_slice() local
687 zval *buf = ds_allocate_zval_buffer(capacity); in ds_vector_slice()
696 return ds_vector_from_buffer(buf, capacity, length); in ds_vector_slice()