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

Most significant bit and bool-to-int conversions. #15

Merged
merged 3 commits into from
Jul 30, 2015
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Fixed a bug where converting a bool to int instead to byte (which is …
…the native size)
  • Loading branch information
redknightlois committed Jul 29, 2015
commit b16153dcf39713b5fd6f2e784a327d2fb48f990b
4 changes: 2 additions & 2 deletions BenchmarkDotNet.Samples/Jit_BoolToInt.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ public int UnsafeConvert()
unsafe
{
bool v1 = first;
int sum = *(int*)(&v1);
int sum = *(byte*)(&v1);

bool v2 = second;
sum += *(int*)(&v2);
sum += *(byte*)(&v2);
return sum;
}
}
Expand Down