-
Notifications
You must be signed in to change notification settings - Fork 981
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
chore: Remove manual memory management from stats #2550
Conversation
Signed-off-by: Vladislav Oleshko <vlad@dragonflydb.io>
ServerState::Stats& ServerState::Stats::Add(unsigned num_shards, const ServerState::Stats& other) { | ||
static_assert(sizeof(Stats) == 13 * 8, "Stats size mismatch"); | ||
ServerState::Stats& ServerState::Stats::Add(const ServerState::Stats& other) { | ||
static_assert(sizeof(Stats) == 14 * 8, "Stats size mismatch"); |
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.
I think this assertion is better move under the Stats definition
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.
and instead of 8 use sizeof(int64_t)
for (unsigned i = 0; i < num_shards; ++i) { | ||
this->tx_width_freq_arr[i] += other.tx_width_freq_arr[i]; | ||
} | ||
this->tx_width_freq_arr = other.tx_width_freq_arr; |
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.
should never happen
Accidentally deleted this branch 😬 |
Cleans up #2328