amalgamation sqlite

后端 未结 1 1163
刺人心
刺人心 2021-01-14 00:37

I\'m recently reading the source code of sqlite3. In the amalgamation version, there are only four files. On the official website, they say that:

"t

相关标签:
1条回答
  • 2021-01-14 01:19

    You can have similar result if you parse all .c file, extract all #includes, then build a huge file that first lists all includes, then lists all the other content of those .c files.

    This way you have all code in a single translation unit which allows the compiler to see all code at once and perform better optimizations. This is relevant for most C compilers yet newest compilers feature so-called link-time code generation that allows the compiler to see code of multiple translation units at once (at link time) and generate better code even without the amalgamation trick.

    0 讨论(0)
提交回复
热议问题