Lines Matching refs:index
39 uintptr_t index; /* data[index-1] is the object address */
122 /* Returns control->object.index; set index if not allocated yet. */
124 uintptr_t index = __atomic_load_n(&control->object.index, __ATOMIC_ACQUIRE);
125 if (!index) {
129 index = control->object.index;
130 if (!index) {
131 index = ++emutls_num_object;
132 __atomic_store_n(&control->object.index, index, __ATOMIC_RELEASE);
136 return index;
149 * which must be no smaller than the given index.
151 static __inline uintptr_t emutls_new_data_array_size(uintptr_t index) {
156 return ((index + 1 + 15) & ~((uintptr_t)15)) - 1;
160 * Extends its size if necessary to hold address at index.
163 emutls_get_address_array(uintptr_t index) {
166 uintptr_t new_size = emutls_new_data_array_size(index);
169 } else if (index > array->size) {
171 uintptr_t new_size = emutls_new_data_array_size(index);
182 uintptr_t index = emutls_get_index(control);
183 emutls_address_array* array = emutls_get_address_array(index);
184 if (array->data[index - 1] == NULL)
185 array->data[index - 1] = emutls_allocate_object(control);
186 return array->data[index - 1];