[FFmpeg-devel] Suggestion for a centralized language-tag facility in libavformat

Reimar Döffinger Reimar.Doeffinger
Sat Apr 11 22:33:33 CEST 2009


Please do not top post, and do not quote more than relevant to your
reply.

On Sat, Apr 11, 2009 at 10:15:00PM +0200, cyril comparon wrote:
> However, I would like to understand the reasons why you think the data
> structure holding the language tags should be changed. That would help
> me submitting a more relevant implementation.

simple, consider
const char * const test[] = {"abc", "def"};
vs.
const char test2[][4] = {"abc", "def"};

on a 64 bit machine, test allocates 16 bytes of memory, plus 8 bytes for
the strings. Makes 24 bytes. In addition, due to relocation those
pointers to the strings have to be manipulated, thus those 16 bytes are
not shareable between different instances of the library (and other
related disadvantages).
In contrast, test allocates 8 bytes of memory, and those can be shared
between all library instances on the computer and if necessary can be
reloaded directly from the executable file so there is no need to write
them into the swap file when "swapping out".



More information about the ffmpeg-devel mailing list