Lines Matching refs:capacity

11     deque->head = (deque->head + 1) & (deque->capacity - 1);  in ds_deque_increment_head()
16 deque->head = (deque->head - 1) & (deque->capacity - 1); in ds_deque_decrement_head()
21 deque->tail = (deque->tail + 1) & (deque->capacity - 1); in ds_deque_increment_tail()
26 deque->tail = (deque->tail - 1) & (deque->capacity - 1); in ds_deque_decrement_tail()
48 deque->capacity = DS_DEQUE_MIN_CAPACITY; in ds_deque()
60 deque->capacity = ds_deque_get_capacity_for_size(size); in ds_deque_preallocated()
61 deque->buffer = ds_allocate_zval_buffer(deque->capacity); in ds_deque_preallocated()
69 static ds_deque_t *ds_deque_from_buffer(zval *buffer, zend_long capacity, zend_long size) in ds_deque_from_buffer() argument
74 deque->capacity = capacity; in ds_deque_from_buffer()
85 zval *buffer = ds_allocate_zval_buffer(deque->capacity); in ds_deque_clone()
94 return ds_deque_from_buffer(buffer, deque->capacity, deque->size); in ds_deque_clone()
121 zend_long r = deque->capacity - h; // Number of values on the right. in ds_deque_reset_head()
132 zval *buffer = ds_allocate_zval_buffer(deque->capacity); in ds_deque_reset_head()
145 static void ds_deque_reallocate(ds_deque_t *deque, zend_long capacity) in ds_deque_reallocate() argument
149 …deque->buffer = ds_reallocate_zval_buffer(deque->buffer, capacity, deque->capacity, deque->size); in ds_deque_reallocate()
150 deque->capacity = capacity; in ds_deque_reallocate()
157 ds_deque_reallocate(deque, deque->capacity << 1); in ds_deque_double_capacity()
162 zend_long capacity = ds_deque_get_capacity_for_size(size); in ds_deque_allocate() local
168 if (capacity > deque->capacity) { in ds_deque_allocate()
169 ds_deque_reallocate(deque, capacity); in ds_deque_allocate()
176 if (deque->size <= deque->capacity / 4) { in ds_deque_auto_truncate()
177 if (deque->capacity / 2 >= DS_DEQUE_MIN_CAPACITY) { in ds_deque_auto_truncate()
178 ds_deque_reallocate(deque, deque->capacity / 2); in ds_deque_auto_truncate()
192 …ue->buffer = ds_reallocate_zval_buffer(deque->buffer, DS_DEQUE_MIN_CAPACITY, deque->capacity, 0); in ds_deque_clear()
196 deque->capacity = DS_DEQUE_MIN_CAPACITY; in ds_deque_clear()
217 return (deque->head + index) & (deque->capacity - 1); in ds_deque_lookup_index()
257 zend_long mask = deque->capacity - 1; in ds_deque_reverse()
273 zval *buf = ds_allocate_zval_buffer(deque->capacity); in ds_deque_reversed()
282 return ds_deque_from_buffer(buf, deque->capacity, deque->size); in ds_deque_reversed()
379 if (deque->size == deque->capacity) { in ds_deque_push()
441 if ((deque->tail + argc) > deque->capacity) { in ds_deque_insert_va()
477 zend_long mask = deque->capacity - 1; in ds_deque_find_index()
585 return &deque->buffer[(deque->tail - 1) & (deque->capacity - 1)]; in ds_deque_get_last()
701 zval *buffer = ds_allocate_zval_buffer(deque->capacity); in ds_deque_map()
727 return ds_deque_from_buffer(buffer, deque->capacity, deque->size); in ds_deque_map()
738 zval *buf = ds_allocate_zval_buffer(deque->capacity); in ds_deque_filter_callback()
779 zval *buf = ds_allocate_zval_buffer(deque->capacity); in ds_deque_filter()