[FFmpeg-devel] [PATCH 1/4] lavu: add simple array implementation

Lukasz M lukasz.m.luki at gmail.com
Mon Mar 3 11:00:18 CET 2014


W dniu poniedziałek, 3 marca 2014 Michael Niedermayer <michaelni at gmx.at>
napisał(a):

> On Mon, Mar 03, 2014 at 01:59:43AM +0100, Lukasz Marek wrote:
> >
> > >You're adding it to lavu, and it's not marked as internal/experimental.
> If
> > >it stinks or needs 3 API updates or re-implementations, the old cruft
> > >sticks around for years to come.
> >
> > Can you precise how to mark it? I added it as public, but don't
> > understand how can i make it experimental.
> >
>
> > >That's why we now have 2 (and with yours, soon 3) array implementations.
> > >Can we stick to one? At least java uses the same API for all its
> array/list
> > >things.
> >
> > The existing two doesn't allow to free "objects" with allocated
> > pointers inside. If you fix them then you have 4. I really think it
> > is better to have one common for wide range of use cases. I can
> > refactor existing code to use mine if accepted.
>
> if i have an array of "object" with pointers inside them and want
> to free them id do
>
> for(i=0; i<arraysize; i++)
>     my_free(my_array + i);
>
> that needs no API beyond ANSI/ISO C
> what am i missing ?
>

nothing. existing array impl is not so smart to do that on memory
allocation fail AFAIR.


More information about the ffmpeg-devel mailing list