[FFmpeg-devel] [RFC] AES init

Trent Piepho xyzzy
Sun May 13 20:28:03 CEST 2007


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.




More information about the ffmpeg-devel mailing list