Lines Matching refs:index
46 #define encode_index_and_type(index, type) (~((index<<3) | type))
57 size_t _search; // lowest index in list which *might* be unused
95 for (size_t index = list->_size; index < new_size; ++index)
96 new_list[index] = EMPTY_SLOT;
105 size_t index;
109 // find the lowest unused index in _list
110 index = list->_search;
111 while (list->_buffer[index] != EMPTY_SLOT)
112 index++;
114 list->_buffer[index] = NULL;
115 return index;
128 __block size_t index;
136 index = _find_unused_index(list);
138 auto_zone_set_write_barrier(gc_zone, &list->_buffer[index], obj);
140 auto_assign_weak_reference(gc_zone, obj, (const void **)&list->_buffer[index], NULL);
144 xref = encode_index_and_type(index, ref_type);
158 size_t index = decode_index(ref);
162 if (index >= list->_size) {
166 result = (id)list->_buffer[index];
168 result = (id)auto_read_weak_reference(gc_zone, &list->_buffer[index]);
184 size_t index = decode_index(ref);
188 if (index >= list->_size) {
193 old_value = (id)list->_buffer[index];
195 old_value = (id)auto_read_weak_reference(gc_zone, &list->_buffer[index]);
196 auto_assign_weak_reference(gc_zone, NULL, (const void **)&list->_buffer[index], NULL);
198 list->_buffer[index] = EMPTY_SLOT;
202 if (list->_search > index)
203 list->_search = index;