FFmpeg
|
Go to the source code of this file.
Macros | |
#define | FF_DYNARRAY_ADD(av_size_max, av_elt_size, av_array, av_size, av_success, av_failure) |
Add an element of to a dynamic array. More... | |
#define FF_DYNARRAY_ADD | ( | av_size_max, | |
av_elt_size, | |||
av_array, | |||
av_size, | |||
av_success, | |||
av_failure | |||
) |
Add an element of to a dynamic array.
The array is reallocated when its number of elements reaches powers of 2. Therefore, the amortized cost of adding an element is constant.
In case of success, the pointer to the array is updated in order to point to the new grown array, and the size is incremented.
av_size_max | maximum size of the array, usually the MAX macro of the type of the size |
av_elt_size | size of the elements in the array, in bytes |
av_array | pointer to the array, must be a lvalue |
av_size | size of the array, must be an integer lvalue |
av_success | statement to execute on success; at this point, the size variable is not yet incremented |
av_failure | statement to execute on failure; if this happens, the array and size are not changed; the statement can end with a return or a goto |
Definition at line 45 of file dynarray.h.
Referenced by av_dynarray2_add(), av_dynarray_add(), and av_dynarray_add_nofree().