Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #if FF_API_FAST_MALLOC && CONFIG_SHARED && HAVE_SYMVER
- FF_SYMVER(void*, av_fast_realloc, (void *ptr, unsigned int *size, size_t min_size), LIBNAME)
- {
- return av_fast_realloc(ptr, size, min_size);
- }
- FF_SYMVER(void, av_fast_malloc, (void *ptr, unsigned int *size, size_t min_size), LIBNAME)
- {
- av_fast_malloc(ptr, size, min_size);
- }
- #endif
- static inline int ff_fast_malloc(void *ptr, unsigned int *size, size_t min_size, int zero_realloc)
- {
- void **p = ptr;
- if (min_size < *size)
- return 0;
- min_size = FFMAX(17 * min_size / 16 + 32, min_size);
- av_free(*p);
- *p = zero_realloc ? av_mallocz(min_size) : av_malloc(min_size);
- if (!*p)
- min_size = 0;
- *size = min_size;
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement