pobrn / mktorrent

A simple command line utility to create BitTorrent metainfo files
Other
472 stars 73 forks source link

ALLINONE and EXPORT macros #38

Closed uno20001 closed 4 years ago

uno20001 commented 4 years ago

While browsing the code base I found two macros: ALLINONE and EXPORT. Is there any value this functionality brings to the software? Because I could not figure out why it is beneficial to have just a single translation unit. In a brief correspondence with the current owner of the project, @Rudde, s/he said s/he did not know the origins of these two macros. So this question is mainly directed towards the original author, @esmil (as far as I know).

esmil commented 4 years ago

As far as I recall this was like a poor mans LTO way before it existed in GCC. Similar to LTO compiling everything as a single translation unit allows the compiler to do optimizations (inlining, constant propagation etc.) across files. It was probably never worth it, but these days you can just add -flto to CFLAGS to get a similar effect.

uno20001 commented 4 years ago

I see. What is your opinion on removing them from the code altogether?

esmil commented 4 years ago

I think that's a great idea. but I've handed the project over to Rudde, so it's his call.