Menu

#162 Multiple instances of ID3_v1_genre_description table

feature request
open
nobody
5
2005-03-10
2005-03-10
atgraham
No

The table ID3_v1_genre_description that is declared in
globals.h should not be defined in a header file. It
should be declared extern in the header and defined in
globals.cpp.

If the table is defined in the globals.h header, then
most compilers will compile the entire table into every
object that includes the header, quickly bloating any
applications that use ID3lib. In embedded
applications, especially, this can be detrimental.

For statically-linked applications that use gcc, there
is a workaround for this problem -- if you use the
"-fdata-sections" when compiling any source file that
uses ID3lib, and "--gc-sections" when linking them,
linker will throw away the tables that aren't used. Of
course, this only works if the application source files
don't use the table directly (i.e. they only use it
indirectly through API calls like ID3_GetGenre,
ID3_AddGenre, etc.). Additionally, this workaround can
be inconvenient for obvious reasons.

Discussion


Log in to post a comment.