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.
This commit is contained in:
Anton Khirnov
2017-03-30 17:02:39 +02:00
parent 3d69dd65c6
commit 04b0f0e371
2 changed files with 16 additions and 12 deletions

View File

@@ -138,6 +138,20 @@ int av_reallocp(void *ptr, size_t size)
return 0;
}
void *av_malloc_array(size_t nmemb, size_t size)
{
if (!size || nmemb >= INT_MAX / size)
return NULL;
return av_malloc(nmemb * size);
}
void *av_mallocz_array(size_t nmemb, size_t size)
{
if (!size || nmemb >= INT_MAX / size)
return NULL;
return av_mallocz(nmemb * size);
}
void *av_realloc_array(void *ptr, size_t nmemb, size_t size)
{
if (!size || nmemb >= INT_MAX / size)