1.1 --- a/src/array.c Thu Jul 04 22:23:15 2019 +0200 1.2 +++ b/src/array.c Thu Jul 04 22:32:03 2019 +0200 1.3 @@ -143,6 +143,24 @@ 1.4 return 0; 1.5 } 1.6 1.7 +int ucx_array_set(UcxArray *array, size_t index, void *data) { 1.8 + if (index >= array->size) { 1.9 + if (ucx_array_reserve(array, index+1)) { 1.10 + return 1; 1.11 + } 1.12 + array->size = index+1; 1.13 + } 1.14 + 1.15 + void *dest = ucx_array_at(*array, index); 1.16 + if (data) { 1.17 + memcpy(dest, data, array->elemsize); 1.18 + } else { 1.19 + memset(dest, 0, array->elemsize); 1.20 + } 1.21 + 1.22 + return 0; 1.23 +} 1.24 + 1.25 int ucx_array_concat(UcxArray *array1, const UcxArray *array2) { 1.26 1.27 if (array1->elemsize != array2->elemsize)