On Wed, 2012-07-04 at 14:02 -0700, Ronald S. Bultje wrote:
> > Why not simply add av_calloc() to lavu and use it? These kind of
> > allocations are all over the place - it'd make them prettier. I've
> > suggested this before in [1]. You could even have it static inline.
> >
> > IMO muxers shouldn't have to care about whatever the maximum allocation
> > size is. That would also allow changing said size more easily (it'd be
> > confined to mem.*)
> >
> > [1] http://www.mail-archive.com/libav-devel@libav.org/msg16665.html
> 
> I'd say send a patch? Also, it'd be faster if av_calloc() were inlined
> in a header file, since then the division (INT_MAX / sizeof(..)) can
> be done by the compiler.

Call overhead is not a problem (if it were then there are too many
allocations). Using a function would result in smaller code which I'd
say is a plus when speed isn't an issue.

On Wed, 2012-07-04 at 21:32 +0200, Luca Barbato wrote:
> You wouldn't have to check nonetheless?

av_calloc() would return NULL if the allocation is too large.

Anyway, I'll cobble together a patch.

/Tomas

_______________________________________________
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to