作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我应该改用它吗?看起来它只是更紧凑。
https://ffmpeg.org/doxygen/trunk/group__lavu__mem__funcs.html
最佳答案
这是最新版本的整个函数,它实际上调用了av_realloc
但首先检查提供的缓冲区是否像文档中所说的那样大,如果是,则不执行 av_realloc
,实际上它在这种情况下除了返回相同的缓冲区之外什么也不做。希望有帮助。
void *av_fast_realloc(void *ptr, unsigned int *size, size_t min_size)
{
if (min_size <= *size)
return ptr;
if (min_size > max_alloc_size - 32) {
*size = 0;
return NULL;
}
min_size = FFMIN(max_alloc_size - 32, FFMAX(min_size + min_size / 16 + 32, min_size));
ptr = av_realloc(ptr, min_size);
/* we could set this to the unmodified min_size but this is safer
* if the user lost the ptr and uses NULL now
*/
if (!ptr)
min_size = 0;
*size = min_size;
return ptr;
}
关于ffmpeg - av_fast_realloc 比 av_realloc 快吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48297132/
我应该改用它吗?看起来它只是更紧凑。 https://ffmpeg.org/doxygen/trunk/group__lavu__mem__funcs.html 最佳答案 这是最新版本的整个函数,它实
我是一名优秀的程序员,十分优秀!