diff options
Diffstat (limited to 'src/egl/main/eglarray.c')
-rw-r--r-- | src/egl/main/eglarray.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/egl/main/eglarray.c b/src/egl/main/eglarray.c index 41550bb4bed..781d07fc1ce 100644 --- a/src/egl/main/eglarray.c +++ b/src/egl/main/eglarray.c @@ -84,6 +84,22 @@ _eglAppendArray(_EGLArray *array, void *elem) /** + * Erase an element from an array. + */ +void +_eglEraseArray(_EGLArray *array, EGLint i, void (*free_cb)(void *)) +{ + if (free_cb) + free_cb(array->Elements[i]); + if (i < array->Size - 1) { + memmove(&array->Elements[i], &array->Elements[i + 1], + (array->Size - i - 1) * sizeof(array->Elements[0])); + } + array->Size--; +} + + +/** * Find in an array for the given element. */ void * |