Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prefer GenerateExportHeader to EXPORT_ALL_SYMBOLS #49

Open
mathstuf opened this issue Oct 26, 2019 · 1 comment
Open

Prefer GenerateExportHeader to EXPORT_ALL_SYMBOLS #49

mathstuf opened this issue Oct 26, 2019 · 1 comment

Comments

@mathstuf
Copy link

In my experience, having finer control over exported symbols is much better than exporting all of them (either via the default behavior of GCC-and-friends or via WINDOWS_EXPORT_ALL_SYMBOLS). Among these benefits:

  • smaller binary size (internal template instantiation names can be hidden)
  • better inlining; if the compiler/LTO knows a symbol isn't exposed at all, it can be more aggressively inlined)
  • less chance of someone using a symbol you didn't intend to expose (more a problem in C than C++)

Instead, GenerateExportHeader should be used to generate a header with _EXPORT macros to decorate classes, functions, and variables as being available to other libraries.

@drdanz
Copy link
Member

drdanz commented Oct 29, 2019

👍
Unfortunately we are dealing with lazy researchers who ignore this kind of issues, therefore EXPORT_ALL_SYMBOLS is the quick and dirty way to achieve the same result. 😝

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants