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

mwcc_orderedhashmap.t: limit cycles number for memory sanitizer #338

Merged

Conversation

alexander-e1off
Copy link
Collaborator

No description provided.

@alexander-e1off alexander-e1off requested a review from a team as a code owner June 27, 2024 12:37
Signed-off-by: Aleksandr Ivanov <[email protected]>
@alexander-e1off alexander-e1off changed the title mwcc_orderedhashmap.t: limit cycles number for sanitizers mwcc_orderedhashmap.t: limit cycles number for memory sanitizer Jun 27, 2024
Copy link
Collaborator

@678098 678098 left a comment

Choose a reason for hiding this comment

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

  1. Let's make the code block defining k_NUM_ELEMENTS identical for 2 UTs. There is no need to keep these 2 different inverted conditions.
  2. It is not enough to just check if __has_feature is defined. This macro can exist but all sanitizers might be disabled.
  3. I think we should still check for __SANITIZE_MEMORY__ aka GCC-supported macro. https://github.com/torvalds/linux/blob/afcd48134c58d6af45fb3fdb648f1260b20f2326/include/linux/compiler-clang.h#L59
  4. Overall, I think it's not necessary to try to fit everything in one if condition. You can make many branches for each specific case with very basic conditions for each branch. It will be more code lines, but it's more maintainable than one complex condition.
  5. Not necessary to put __has_feature(memory_sanitizer) check to the preprocessor #if, you can use a ternary assignment for k_NUM_ELEMENTS instead

Signed-off-by: Aleksandr Ivanov <[email protected]>
Signed-off-by: Aleksandr Ivanov <[email protected]>
@alexander-e1off
Copy link
Collaborator Author

Addressed review comments

Signed-off-by: Aleksandr Ivanov <[email protected]>
Signed-off-by: Aleksandr Ivanov <[email protected]>
Copy link
Collaborator

@678098 678098 left a comment

Choose a reason for hiding this comment

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

Looks good!

@alexander-e1off alexander-e1off merged commit 24ad25b into bloomberg:main Jun 27, 2024
23 checks passed
@alexander-e1off alexander-e1off deleted the fix_orderedhashmap_test branch July 1, 2024 09:40
lukedigiovanna pushed a commit to lukedigiovanna/blazingmq that referenced this pull request Jul 2, 2024
alexander-e1off added a commit to alexander-e1off/blazingmq that referenced this pull request Oct 24, 2024
alexander-e1off added a commit to alexander-e1off/blazingmq that referenced this pull request Oct 24, 2024
alexander-e1off added a commit to alexander-e1off/blazingmq that referenced this pull request Oct 24, 2024
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.

2 participants