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

[Utils] Templatify AssertLockHeld to placate clang warning #948

Merged
merged 1 commit into from
May 26, 2021

Conversation

Zannick
Copy link
Collaborator

@Zannick Zannick commented May 18, 2021

By changing the type of the lock from void* (which has no capability) to the actual type (which does).

(Templates more or less have to be defined in a header, included in a header, or specializations explicitly declared in a header, so the actual implementation here is to call the original function that took a void*.)

Test Results

Built and run veild/veil-cli with clang. Built veild/veil-cli with clang with -DDEBUG_LOCKORDER.

By changing the type of the lock from void* (which has no capability)
to the actual type (which does).

Minimize the amount of code we have to move into sync.h by pointing
the AssertLockHeldInternal template at the original function that takes
void*.
@Zannick Zannick self-assigned this May 18, 2021
@CaveSpectre11 CaveSpectre11 added the Tag: Waiting For Code Review Waiting for code review from a core developer label May 18, 2021
Copy link
Collaborator

@CaveSpectre11 CaveSpectre11 left a comment

Choose a reason for hiding this comment

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

utACK 185c71f

Copy link
Collaborator

@codeofalltrades codeofalltrades left a comment

Choose a reason for hiding this comment

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

ACK 185c71f

@codeofalltrades codeofalltrades added Code Review: Passed Tag: Waiting For QA A pull review is waiting for QA to test the pull request and removed Tag: Waiting For Code Review Waiting for code review from a core developer labels May 23, 2021
@codeofalltrades codeofalltrades merged commit 513bdfc into Veil-Project:master May 26, 2021
@Zannick Zannick deleted the clang3 branch October 22, 2021 20:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Code Review: Passed Tag: Waiting For QA A pull review is waiting for QA to test the pull request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants