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

Refactor signpost code to be safer, more debuggable #1461

Closed
wants to merge 5 commits into from

Conversation

Adlai-Holler
Copy link
Member

@Adlai-Holler Adlai-Holler commented Apr 19, 2019

Now that we're all-C++, we can use static constexpr bool like this to still verify that something would build if the bool were either way, but still strip code that is unreachable.

This fixes warnings about availability when profiling, and it makes the profiling code more readable & syntax highlighted, and it makes sure that you can't break profiling builds inadvertently.

Confirmed that even in debug mode, unreachable code is totally stripped and the entire ASSignpost* function call is not even present at all in the disassembly unless PROFILE=1.

Over time I'd like us to move away from macros when it makes sense.

@TextureGroup TextureGroup deleted a comment Apr 20, 2019
@TextureGroup TextureGroup deleted a comment Apr 20, 2019
@TextureGroup TextureGroup deleted a comment Apr 20, 2019
@TextureGroup TextureGroup deleted a comment Apr 22, 2019
@TextureGroup TextureGroup deleted a comment Apr 22, 2019
@Adlai-Holler
Copy link
Member Author

@maicki @nguyenhuy @garrettmoon Review plz?

Copy link
Member

@nguyenhuy nguyenhuy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice

@Adlai-Holler
Copy link
Member Author

I'm proud of this but I just learned about the new and incredible os_signpost API, which will require the use of macros, and which has such a different API that everything will need to change.

Closing this in favor of a diff that I hope comes soon that adds support for that, probably keeping the macros.

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.

3 participants