• Home
  • Raw
  • Download

Lines Matching refs:array

40 _eglGrowArray(_EGLArray *array)  in _eglGrowArray()  argument
45 new_size = array->MaxSize; in _eglGrowArray()
46 while (new_size <= array->Size) in _eglGrowArray()
49 elems = realloc(array->Elements, new_size * sizeof(array->Elements[0])); in _eglGrowArray()
52 array->Name, new_size); in _eglGrowArray()
56 array->Elements = elems; in _eglGrowArray()
57 array->MaxSize = new_size; in _eglGrowArray()
69 _EGLArray *array; in _eglCreateArray() local
71 array = calloc(1, sizeof(*array)); in _eglCreateArray()
72 if (array) { in _eglCreateArray()
73 array->Name = name; in _eglCreateArray()
74 array->MaxSize = (init_size > 0) ? init_size : 1; in _eglCreateArray()
75 if (!_eglGrowArray(array)) { in _eglCreateArray()
76 free(array); in _eglCreateArray()
77 array = NULL; in _eglCreateArray()
81 return array; in _eglCreateArray()
89 _eglDestroyArray(_EGLArray *array, void (*free_cb)(void *)) in _eglDestroyArray() argument
93 for (i = 0; i < array->Size; i++) in _eglDestroyArray()
94 free_cb(array->Elements[i]); in _eglDestroyArray()
96 free(array->Elements); in _eglDestroyArray()
97 free(array); in _eglDestroyArray()
105 _eglAppendArray(_EGLArray *array, void *elem) in _eglAppendArray() argument
107 if (array->Size >= array->MaxSize && !_eglGrowArray(array)) in _eglAppendArray()
110 array->Elements[array->Size++] = elem; in _eglAppendArray()
118 _eglEraseArray(_EGLArray *array, EGLint i, void (*free_cb)(void *)) in _eglEraseArray() argument
121 free_cb(array->Elements[i]); in _eglEraseArray()
122 if (i < array->Size - 1) { in _eglEraseArray()
123 memmove(&array->Elements[i], &array->Elements[i + 1], in _eglEraseArray()
124 (array->Size - i - 1) * sizeof(array->Elements[0])); in _eglEraseArray()
126 array->Size--; in _eglEraseArray()
134 _eglFindArray(_EGLArray *array, void *elem) in _eglFindArray() argument
138 if (!array) in _eglFindArray()
141 for (i = 0; i < array->Size; i++) in _eglFindArray()
142 if (array->Elements[i] == elem) in _eglFindArray()
152 _eglFilterArray(_EGLArray *array, void **data, EGLint size, in _eglFilterArray() argument
157 if (!array) in _eglFilterArray()
161 for (i = 0; i < array->Size; i++) { in _eglFilterArray()
162 if (filter(array->Elements[i], filter_data)) { in _eglFilterArray()
164 data[count] = array->Elements[i]; in _eglFilterArray()
173 count = (size < array->Size) ? size : array->Size; in _eglFilterArray()
174 memcpy(data, array->Elements, count * sizeof(array->Elements[0])); in _eglFilterArray()
177 count = array->Size; in _eglFilterArray()
190 _eglFlattenArray(_EGLArray *array, void *buffer, EGLint elem_size, EGLint size, in _eglFlattenArray() argument
195 if (!array) in _eglFlattenArray()
198 count = array->Size; in _eglFlattenArray()
204 flatten(array->Elements[i], in _eglFlattenArray()