summaryrefslogtreecommitdiff
path: root/libavutil/mem.h
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2017-03-30 17:02:39 +0200
committerAnton Khirnov <anton@khirnov.net>2017-04-26 09:05:28 +0200
commit04b0f0e371ff81b682274b574fb465ba4395c09f (patch)
treec7b303ca30e2ac9bfb6a946ae7ea1ed79a053a63 /libavutil/mem.h
parent3d69dd65c6771c28d3bf4e8e53a905aa8cd01fd9 (diff)
mem: uninline av_malloc(z)_array()
Inlining public functions hardcodes their implementation into the ABI, so it should be avoided unless there is a very good reason for it. No such reason exists in this case.
Diffstat (limited to 'libavutil/mem.h')
-rw-r--r--libavutil/mem.h14
1 files changed, 2 insertions, 12 deletions
diff --git a/libavutil/mem.h b/libavutil/mem.h
index f3cf56c498..a03ba2f528 100644
--- a/libavutil/mem.h
+++ b/libavutil/mem.h
@@ -89,12 +89,7 @@ void *av_malloc(size_t size) av_malloc_attrib av_alloc_size(1);
* be allocated.
* @see av_malloc()
*/
-av_alloc_size(1, 2) static inline void *av_malloc_array(size_t nmemb, size_t size)
-{
- if (!size || nmemb >= INT_MAX / size)
- return NULL;
- return av_malloc(nmemb * size);
-}
+av_alloc_size(1, 2) void *av_malloc_array(size_t nmemb, size_t size);
/**
* Allocate or reallocate a block of memory.
@@ -202,12 +197,7 @@ void *av_mallocz(size_t size) av_malloc_attrib av_alloc_size(1);
* @see av_mallocz()
* @see av_malloc_array()
*/
-av_alloc_size(1, 2) static inline void *av_mallocz_array(size_t nmemb, size_t size)
-{
- if (!size || nmemb >= INT_MAX / size)
- return NULL;
- return av_mallocz(nmemb * size);
-}
+av_alloc_size(1, 2) void *av_mallocz_array(size_t nmemb, size_t size);
/**
* Duplicate the string s.