[FFmpeg-devel] [PATCH] add av_fast_malloc

Michael Niedermayer michaelni
Sun Apr 12 15:02:25 CEST 2009

On Sun, Apr 12, 2009 at 02:57:17PM +0200, Reimar D?ffinger wrote:
> On Sun, Apr 12, 2009 at 02:42:01PM +0200, Michael Niedermayer wrote:
> > On Sun, Apr 12, 2009 at 02:10:58PM +0200, Reimar D?ffinger wrote:
> > > Or you could give av_fast_malloc a return value, but IMO that would be
> > > a more confusing API.
> > 
> > i always liked to make it explicit what is changed by using return ...
> Well, since there are two things changed that does not really work that
> well. Also since the old pointer is invalid you'll basically always want
> to assign to the same variable you passed in, this results in what I
> consider "boilerplate" code, and I just hate, hate, hate that.
> > > In several cases the buffer could be made void *, sometimes avoiding a
> > > few more casts in the process.
> > > There are many solutions, I just considered this the best...
> > 
> > make the arg void * and cast inside the function if you dislie the return
> Sure, here's a variant with that done.


Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Frequently ignored awnser#1 FFmpeg bugs should be sent to our bugtracker. User
questions about the command line tools should be sent to the ffmpeg-user ML.
And questions about how to use libav* should be sent to the libav-user ML.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090412/5a2db363/attachment.pgp>

More information about the ffmpeg-devel mailing list