[Ffmpeg-devel] [RFC] another attempt at memalign realloc

Michael Niedermayer michaelni
Thu Dec 7 20:38:47 CET 2006


Hi

On Thu, Dec 07, 2006 at 07:59:04PM +0100, Reimar D?ffinger wrote:
> Hello,
> On Thu, Dec 07, 2006 at 07:35:19PM +0100, Michael Niedermayer wrote:
> > On Thu, Dec 07, 2006 at 07:05:55PM +0100, Reimar D?ffinger wrote:
> [...]
> > > Actually, there is a rather obvious solution.
> > > Disadvantage: av_realloc without MEMALIGN_HACK now _always_ has the time
> > > and space costs of av_malloc.
> > 
> > this is not good IMHO realloc() on a sane system should be pretty fast if
> > no actuall realloc is needed
> 
> We could of course completely switch to the MEMALIGN_HACK variant :-P.
> Except that, to me it currently seems that we have to choose two out of:
> 1) exact realloc behaviour

IMHO senseless if its hard 
av_realloc(NULL, size) should work 
av_realloc(ptr, 0) = av_free(ptr) is not really usefull IMHO


> 2) full speed for the no-size-change case

i wanted to drop av_fast_realloc() in favor of simply using av_realloc()
if av_realloc() always calls av_malloc() then this is not possible but
OTOH i dont know if droping av_fast_realloc() is a good idea to begin
with?


> 3) alignment preserved over realloc

well i can live without aligned realloc() ...

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

If you really think that XML is the answer, then you definitly missunderstood
the question -- Attila Kinali




More information about the ffmpeg-devel mailing list