[FFmpeg-devel] [PATCH] Move ff_mkv_codec_tags lie on .rodata even with PIC

Diego 'Flameeyes' Pettenò flameeyes
Sat Jan 5 12:24:15 CET 2008


The attached patch makes sure that the ff_mkv_codec_tags table lies
entirely in .rodata even when using PIC. As it is now, it's saved in
.rodata without PIC, and in .data.relro when not using it, as the
string pointers need to be relocated.

With this change the table _might_ use a bit more memory, as all the
string entries will use 16-bytes whatever their actual lenght, but there
is an actual memory use increase for strings whose size (including the
final '\0') is less than 8 (in 64-bit) or 12 (in 32-bit), as in addition
to every string's size, the previous table used an extra pointer (which
is 8 or 4 bytes depending on architecture).

I don't think that summing up all the changes there is an actual
increase, but I didn't do the math myself.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: ffmpeg-rodata-ff_mkv_codec_tags.patch
Type: text/x-patch
Size: 1635 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20080105/6b3ea336/attachment.bin>
-------------- next part --------------

-- 
Diego "Flameeyes" Petten?
http://farragut.flameeyes.is-a-geek.org/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20080105/6b3ea336/attachment.pgp>



More information about the ffmpeg-devel mailing list