-
Notifications
You must be signed in to change notification settings - Fork 379
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WT-2025 Pass simple arguments to compare-and-swap macros
- Loading branch information
1 parent
426c9d2
commit 48648de
Showing
1 changed file
with
12 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48648de
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.
@michaelcahill, you didn't say how you found this one, but it looks like an easy mistake to make in the future, and a difficult one to debug.
What would you think of doing something like this in gcc.h:
and so on? Then we know the argument is only evaluated once.
A positive is we get type checking (the WT_STATIC_ASSERT in the underlying macros goes away).
A negative is we have to specify the address of the object to the inline function, and we have separate functions for pointers and 8B objects.
Thoughts?
48648de
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.
See #2112.