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

Cleanup redundant inline specifiers #262

Merged
merged 1 commit into from
May 24, 2022
Merged

Conversation

wravery
Copy link
Contributor

@wravery wravery commented May 24, 2022

As part of the fix for #255, I tried adding inline to any function or method that was defined in a header. However, that's not what ultimately fixed it, as far as I can tell. I think moving the template methods of the Modified... template structs to an anonymous namespace is what deduplicated their symbols and let -flto=auto work again in GCC 12.

I've tested with and without this in GCC 12 and it looks like it does not change the size of the binary or the benchmark speed. It's just removing some redundant and potentially misleading inline specifiers, since it's implied anytime a method is defined in the body of the class/struct declaration, and it's impossible for any of the type-erased wrappers to call a virtual method on the Model<T> type as an inline method because the whole point of type erasure is that it doesn't know the concrete type.

@wravery wravery merged commit 8c1623a into microsoft:main May 24, 2022
@wravery wravery deleted the inline-cleanup branch May 24, 2022 20:03
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

Successfully merging this pull request may close these issues.

None yet

1 participant