[FFmpeg-devel] [RFC] AES init

Michael Niedermayer michaelni
Sun May 13 21:02:54 CEST 2007


On Sun, May 13, 2007 at 11:28:03AM -0700, Trent Piepho wrote:
> On Sun, 13 May 2007, Luca Barbato wrote:
> > Rich Felker wrote:
> > >
> > > Personally I'm against runtime initialization. All the data is
> > > constant! Include these tables as static arrays in the text/rodata
> > > segment and they'll use less memory and the race condition goes away
> > > permanently without hackish solutions like this.
> >
> > The only problem is that it would consume memory needlessly, still it is
> > less complicated than the other solution proposed.
> Decent OSes have demand paged executables, so the table would only be loaded
> off disk when it is used.  It depends on how big the table is and what ends up
> on the same pages (usually 4k) as to how much gets loaded when it's not
> needed.
> One must also keep in mind that the code to initialize the table and code
> that calls the initializing code also takes up disk space and demand paged
> memory the same way the table does.  In terms of size or speed, there's no
> point in replacing a 256 byte table with 500 bytes of initialization code.


the tables need 8704 byte
the init code needs 634 byte
with -O2 -Os the init code needs 419 byte

tables: 2560 byte
init code: 368 byte

Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

No snowflake in an avalanche ever feels responsible. -- Voltaire
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070513/87abd655/attachment.pgp>

More information about the ffmpeg-devel mailing list