Esempio n. 1
0
void *av_realloc(void *ptr, size_t size)
{
    /* let's disallow possible ambiguous cases */
    if (size > (MAX_MALLOC_SIZE-16))
        return NULL;

    return __mingw_aligned_realloc(ptr, size, ALIGN);
}
Esempio n. 2
0
void *av_realloc(void *ptr, unsigned int size)
{
    /* let's disallow possible ambiguous cases */
    if(size > (INT_MAX-16) )
        return NULL;

#ifndef __GNUC__
    return _aligned_realloc(ptr, size,16);
#else
    return __mingw_aligned_realloc(ptr, size,16);
#endif
}
Esempio n. 3
0
void *av_realloc(void *ptr, size_t size)
{
#if CONFIG_MEMALIGN_HACK
    int diff;
#endif

    /* let's disallow possible ambiguous cases */
    if (size > (max_alloc_size-32))
        return NULL;

#if CONFIG_MEMALIGN_HACK
    //FIXME this isn't aligned correctly, though it probably isn't needed
    if(!ptr) return av_malloc(size);
    diff= ((char*)ptr)[-1];
    ptr= realloc((char*)ptr - diff, size + diff);
    if(ptr) ptr = (char*)ptr + diff;
    return ptr;
#elif HAVE_ALIGNED_MALLOC
    //return _aligned_realloc(ptr, size + !size, ALIGN);
    return __mingw_aligned_realloc(ptr, size + !size, ALIGN); // MPC-HC patch
#else
    return realloc(ptr, size + !size);
#endif
}