Logo Search packages:      
Sourcecode: blender version File versions

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().

    int diff;

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

    //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;
    return realloc(ptr, size);

Generated by  Doxygen 1.6.0   Back to index