}
EAPI void *
-eina_inarray_add(Eina_Inarray *array)
+eina_inarray_grow(Eina_Inarray *array, unsigned int size)
{
void *p;
EINA_MAGIC_CHECK_INARRAY(array, NULL);
+ if (!size) return NULL;
- if (!_eina_inarray_resize(array, array->len + 1))
+ if (!_eina_inarray_resize(array, array->len + size))
return NULL;
p = _eina_inarray_get(array, array->len);
- array->len++;
+ array->len += size;
return p;
}
const void *data) EINA_ARG_NONNULL(1, 2);
/**
- * @brief Allocate a new item at the end of the array.
+ * @brief Allocate new item at the end of the array.
* @param array array object
+ * @param size number of new item to allocate
*
* The returned pointer is only valid until you use any other eina_inarray
* function.
*
* @since 1.8
*/
-EAPI void *eina_inarray_add(Eina_Inarray *array);
+EAPI void *eina_inarray_grow(Eina_Inarray *array, unsigned int size);
/**
* @brief Copy the data to array at position found by comparison function
eina_lock_take(&async_lock);
count = async_queue.len;
- ev = eina_inarray_add(&async_queue);
+ ev = eina_inarray_grow(&async_queue, 1);
if (ev)
{
ev->func = func;
evas_thread_queue_cache_max = 0;
}
- cmd = eina_inarray_add(&evas_thread_queue);
+ cmd = eina_inarray_grow(&evas_thread_queue, 1);
if (cmd)
{
cmd->cb = cb;