[vlc-devel] [vlc-commits] vlc_memalign: use memalign() if posix_memalign() isn't here

Rafaël Carré rafael.carre at gmail.com
Fri Sep 23 00:32:10 CEST 2011

Le Thu, 22 Sep 2011 21:31:27 +0200,
Jean-Baptiste Kempf <jb at videolan.org> a écrit :

> On Thu, Sep 22, 2011 at 03:30:10PM -0400, Rafaël Carré wrote :
> > Is that really a problem? afaict memalign() is not used in "hot" path
> It isn't used in avcodec?

yeah, at init only.

And malloc() & friends are just slow anyway so I don't get the "relocation" problem.

If we write a posix_memalign.c replacement in compat/ we can't use free() on its output so it would be a bit fucked up.

And btw picture_t still has the data_orig pointer so we could just get rid of vlc_memalign:

- Use av_malloc() in avcodec (its output aligned on 32 bytes)
- Store malloc(z+15) output in picture_t::p_data_orig, align in p_data, free(p_data_orig)
- Do the same thing in gradfun (and fix the memleak while at it)

If it makes courmisch happier i'm all for it

Rafaël Carré

More information about the vlc-devel mailing list