Logo Search packages:      
Sourcecode: blender version File versions  Download package

void* av_realloc ( void *  ptr,
unsigned int  size 
)

av_realloc semantics (same as glibc): if ptr is NULL and size > 0, identical to malloc(size). If size is zero, it is identical to free(ptr) and NULL is returned.

Definition at line 100 of file mem.c.

References av_malloc(), and av_realloc().

Referenced by av_fast_realloc(), av_open_input_file(), av_realloc(), av_realloc_static(), and fifo_realloc().

{
#ifdef MEMALIGN_HACK
    int diff;
#endif

    /* lets disallow possible ambiguous cases */
    if(size > INT_MAX)
        return NULL;

#ifdef MEMALIGN_HACK
    //FIXME this isnt aligned correctly though it probably isnt needed
    if(!ptr) return av_malloc(size);
    diff= ((char*)ptr)[-1];
    return realloc(ptr - diff, size + diff) + diff;
#else
    return realloc(ptr, size);
#endif
}


Generated by  Doxygen 1.6.0   Back to index