It does the same as av_calloc(), so one of them should be removed. Given that av_calloc() has the shorter name, it is retained.
Unified · Split
| @@ -14,6 +14,9 @@ libavutil: 2021-04-27 · 13 unmodified lines | ||
| 14 | 14 | |
| 15 | 15 | API changes, most recent first: |
| 16 | 16 | |
| 17 | +2021-09-20 - xxxxxxxxxx - lavu 57.6.100 - mem.h | |
| 18 | + Deprecate av_mallocz_array() as it is identical to av_calloc(). | |
| 19 | + | |
| 17 | 20 | 2021-09-20 - xxxxxxxxxx - lavc 59.9.100 - avcodec.h |
| 18 | 21 | Deprecate AVCodecContext.sub_text_format and the corresponding |
| 19 | 22 | AVOptions. It is unused since the last major bump. |
| @@ -211,6 +211,7 @@ void *av_malloc_array(size_t nmemb, size_t size) · 210 unmodified lines | ||
| 211 | 211 | return av_malloc(result); |
| 212 | 212 | } |
| 213 | 213 | |
| 214 | +#if FF_API_AV_MALLOCZ_ARRAY | |
| 214 | 215 | void *av_mallocz_array(size_t nmemb, size_t size) |
| 215 | 216 | { |
| 216 | 217 | size_t result; |
| @@ -218,6 +219,7 @@ void *av_mallocz_array(size_t nmemb, size_t size) · 1 unmodified line | ||
| 218 | 219 | return NULL; |
| 219 | 220 | return av_mallocz(result); |
| 220 | 221 | } |
| 222 | +#endif | |
| 221 | 223 | |
| 222 | 224 | void *av_realloc_array(void *ptr, size_t nmemb, size_t size) |
| 223 | 225 | { |
| @@ -237,14 +237,15 @@ av_alloc_size(1, 2) void *av_malloc_array(size_t nmemb, size_t size); · 236 unmodified lines | ||
| 237 | 237 | * @see av_mallocz() |
| 238 | 238 | * @see av_malloc_array() |
| 239 | 239 | */ |
| 240 | −av_alloc_size(1, 2) void *av_mallocz_array(size_t nmemb, size_t size); | |
| 240 | +void *av_calloc(size_t nmemb, size_t size) av_malloc_attrib av_alloc_size(1, 2); | |
| 241 | 241 | |
| 242 | +#if FF_API_AV_MALLOCZ_ARRAY | |
| 242 | 243 | /** |
| 243 | − * Equivalent of av_mallocz_array(). | |
| 244 | − * | |
| 245 | − * Created for symmetry with the calloc() C function. | |
| 244 | + * @deprecated use av_calloc() | |
| 246 | 245 | */ |
| 247 | −void *av_calloc(size_t nmemb, size_t size) av_malloc_attrib; | |
| 246 | +attribute_deprecated | |
| 247 | +void *av_mallocz_array(size_t nmemb, size_t size) av_malloc_attrib av_alloc_size(1, 2); | |
| 248 | +#endif | |
| 248 | 249 | |
| 249 | 250 | /** |
| 250 | 251 | * Allocate, reallocate, or free a block of memory. |
| @@ -79,8 +79,8 @@ · 78 unmodified lines | ||
| 79 | 79 | */ |
| 80 | 80 | |
| 81 | 81 | #define LIBAVUTIL_VERSION_MAJOR 57 |
| 82 | −#define LIBAVUTIL_VERSION_MINOR 5 | |
| 83 | −#define LIBAVUTIL_VERSION_MICRO 101 | |
| 82 | +#define LIBAVUTIL_VERSION_MINOR 6 | |
| 83 | +#define LIBAVUTIL_VERSION_MICRO 100 | |
| 84 | 84 | |
| 85 | 85 | #define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \ |
| 86 | 86 | LIBAVUTIL_VERSION_MINOR, \ |
| @@ -114,6 +114,9 @@ · 27 unmodified lines | ||
| 114 | 114 | #ifndef FF_API_COLORSPACE_NAME |
| 115 | 115 | #define FF_API_COLORSPACE_NAME (LIBAVUTIL_VERSION_MAJOR < 58) |
| 116 | 116 | #endif |
| 117 | +#ifndef FF_API_AV_MALLOCZ_ARRAY | |
| 118 | +#define FF_API_AV_MALLOCZ_ARRAY (LIBAVUTIL_VERSION_MAJOR < 58) | |
| 119 | +#endif | |
| 117 | 120 | |
| 118 | 121 | /** |
| 119 | 122 | * @} |