History

avutil/mem: Deprecate av_mallocz_array()

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.

Andreas Rheinhardt committed 5 years ago

Commit 8d5de911 parent 1ea36504 files · +16 −7Browse files

Unified · Split

4 files
  1. doc/APIchanges +3 −0
  2. libavutil/mem.c +2 −0
  3. libavutil/mem.h +6 −5
  4. libavutil/version.h +5 −2
doc/APIchanges+3−0
@@ -14,6 +14,9 @@ libavutil: 2021-04-27 · 13 unmodified lines
14 14
15API changes, most recent first:15API changes, most recent first:
16 16
172021-09-20 - xxxxxxxxxx - lavu 57.6.100 - mem.h
18 Deprecate av_mallocz_array() as it is identical to av_calloc().
19
172021-09-20 - xxxxxxxxxx - lavc 59.9.100 - avcodec.h202021-09-20 - xxxxxxxxxx - lavc 59.9.100 - avcodec.h
18 Deprecate AVCodecContext.sub_text_format and the corresponding21 Deprecate AVCodecContext.sub_text_format and the corresponding
19 AVOptions. It is unused since the last major bump.22 AVOptions. It is unused since the last major bump.
libavutil/mem.c+2−0
@@ -211,6 +211,7 @@ void *av_malloc_array(size_t nmemb, size_t size) · 210 unmodified lines
211 return av_malloc(result);211 return av_malloc(result);
212}212}
213 213
214#if FF_API_AV_MALLOCZ_ARRAY
214void *av_mallocz_array(size_t nmemb, size_t size)215void *av_mallocz_array(size_t nmemb, size_t size)
215{216{
216 size_t result;217 size_t result;
@@ -218,6 +219,7 @@ void *av_mallocz_array(size_t nmemb, size_t size) · 1 unmodified line
218 return NULL;219 return NULL;
219 return av_mallocz(result);220 return av_mallocz(result);
220}221}
222#endif
221 223
222void *av_realloc_array(void *ptr, size_t nmemb, size_t size)224void *av_realloc_array(void *ptr, size_t nmemb, size_t size)
223{225{
libavutil/mem.h+6−5
@@ -237,14 +237,15 @@ av_alloc_size(1, 2) void *av_malloc_array(size_t nmemb, size_t size); · 236 unmodified lines
237 * @see av_mallocz()237 * @see av_mallocz()
238 * @see av_malloc_array()238 * @see av_malloc_array()
239 */239 */
240av_alloc_size(1, 2) void *av_mallocz_array(size_t nmemb, size_t size);240void *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 * @deprecated use av_calloc()
244 *
245 * Created for symmetry with the calloc() C function.
246 */245 */
247void *av_calloc(size_t nmemb, size_t size) av_malloc_attrib;246attribute_deprecated
247void *av_mallocz_array(size_t nmemb, size_t size) av_malloc_attrib av_alloc_size(1, 2);
248#endif
248 249
249/**250/**
250 * Allocate, reallocate, or free a block of memory.251 * Allocate, reallocate, or free a block of memory.
libavutil/version.h+5−2
@@ -79,8 +79,8 @@ · 78 unmodified lines
79 */79 */
80 80
81#define LIBAVUTIL_VERSION_MAJOR 5781#define LIBAVUTIL_VERSION_MAJOR 57
82#define LIBAVUTIL_VERSION_MINOR 582#define LIBAVUTIL_VERSION_MINOR 6
83#define LIBAVUTIL_VERSION_MICRO 10183#define LIBAVUTIL_VERSION_MICRO 100
84 84
85#define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \85#define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
86 LIBAVUTIL_VERSION_MINOR, \86 LIBAVUTIL_VERSION_MINOR, \
@@ -114,6 +114,9 @@ · 27 unmodified lines
114#ifndef FF_API_COLORSPACE_NAME114#ifndef FF_API_COLORSPACE_NAME
115#define FF_API_COLORSPACE_NAME (LIBAVUTIL_VERSION_MAJOR < 58)115#define FF_API_COLORSPACE_NAME (LIBAVUTIL_VERSION_MAJOR < 58)
116#endif116#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 * @}

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t