-
Notifications
You must be signed in to change notification settings - Fork 116
Changing DEBUG constexpr to SNMALLOC_DEBUG #729
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
Conversation
@microsoft-github-policy-service agree |
|
@NeilMonday, Could you elaborate a bit more on this. The snmalloc::DEBUGAre you including the whole namespace, and then getting conflicts? |
In my project, I have a preprocessor definition "DEBUG=1" for debug builds. So, I think this is conflicting with the snmalloc::DEBUG even though it is in its own namespace? |
|
is it possible to use DDEBUG or other prefixed DEBUG macro in your project? Or use #pragma macro_push to guard around the inclusion of snmalloc header? |
Sure, I will look at some alternatives and see what I can do. |
|
So at one point I tried to use the convention that
So if we did snmalloc::DebugThen I would be happy, and I think that would no longer conflict with the pre-processor expansion. That would hopefully fix your issue. It would tidy the code to the unwritten convention. |
|
I think While looking online it seems like #define DEBUG is a common thing in some generic C++ examples (even though it isn't a default from msvc or gcc). So it seems like it could happen to someone else in the future. |
… DEBUG that may exist in other projects.
5d847c1 to
d9b6bfd
Compare
mjp41
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks for the contribution @NeilMonday.
|
@NeilMonday if you're happy can you mark as "Ready for review" and we'll merge this. |
|
@SchrodingerZhu thanks for the suggestions. I think it is probably best to avoid |
Defining the constexpr DEBUG caused problems when building SNMALLOC into our project. This change simply changes the constexpr's name to SNMALLOC_DEBUG.