-
Notifications
You must be signed in to change notification settings - Fork 24
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
Tracing Service #53
base: master
Are you sure you want to change the base?
Tracing Service #53
Conversation
|
||
} | ||
|
||
struct App { | ||
// See Ring::add below for the reason of this assertion | ||
static_assert(!(MaxEntries & 1), "MaxEntries must be 2^M"); |
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.
That only check that the number is pair. To check for 2^M use this instead:
https://github.com/RAttab/lockless/blob/master/src/utils.h#L30
This checks that there's only one bit set which means that you're a power of 2 that's greater then 0
} | ||
} | ||
|
||
private: | ||
std::array<TraceEntry, MaxEntries> entries; | ||
uint64_t index; | ||
struct Ring { |
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.
Personal style comment which you're free to ignore: since you're in a cc file, you don't have to shove everything within a single class. I'd just shove them at file scope in an anonymous namespace which reduce the amount of crap you have in your class and makes everything easier to read and less indented.
This Pull Request includes two components :