[FFmpeg-devel] tools: crypto_bench: Added support for Twofish

Michael Niedermayer michaelni at gmx.at
Sat Feb 14 13:05:20 CET 2015


On Sat, Feb 14, 2015 at 11:57:30AM +0100, Nicolas George wrote:
> Le sextidi 26 pluviôse, an CCXXIII, Michael Niedermayer a écrit :
> > > +static void run_lavu_twofish(uint8_t *output,
> > > +                              const uint8_t *input, unsigned size)
> > > +{
> > > +    static struct AVTWOFISH *twofish;
> > > +    if (!twofish && !(twofish = av_twofish_alloc()))
> > the memory should be freed somewhere
> 
> All the other benchmarks already work like that, without freeing.
> 
> > otherwise memory debuggers would likely display a warning about a
> > memleak (which could make it harder to see real problems)
> 
> The variable is declared static, so the pointed memory is considered still
> reachable even at the end of the program. If a memory debugger is not
> capable of seeing that, it is not worth using. The same happens for the
> default mutex and co.

indeed
ive no more comments, the patch should be fine


[...]


-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Its not that you shouldnt use gotos but rather that you should write
readable code and code with gotos often but not always is less readable
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20150214/f2857488/attachment.asc>


More information about the ffmpeg-devel mailing list