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

src: simplify UnionBytes #29116

Closed
wants to merge 1 commit into from

Conversation

bnoordhuis
Copy link
Member

Before this commit it was using a tagged union to store the one-byte and
two-byte pointers.

From a sizeof(UnionBytes) perspective that makes no difference - there
is a hole between the tag and the union - and it makes the code just a
little harder to reason about, IMO.

Before this commit it was using a tagged union to store the one-byte and
two-byte pointers.

From a `sizeof(UnionBytes)` perspective that makes no difference - there
is a hole between the tag and the union - and it makes the code just a
little harder to reason about, IMO.
@nodejs-github-bot nodejs-github-bot added the c++ Issues and PRs that require attention from people who are familiar with C++. label Aug 14, 2019
@nodejs-github-bot
Copy link
Collaborator

@bnoordhuis
Copy link
Member Author

The test failure is #27611.

@nodejs-github-bot
Copy link
Collaborator

@Trott
Copy link
Member

Trott commented Aug 16, 2019

Landed in 841df6a

@Trott Trott closed this Aug 16, 2019
Trott pushed a commit that referenced this pull request Aug 16, 2019
Before this commit it was using a tagged union to store the one-byte and
two-byte pointers.

From a `sizeof(UnionBytes)` perspective that makes no difference - there
is a hole between the tag and the union - and it makes the code just a
little harder to reason about, IMO.

PR-URL: #29116
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
targos pushed a commit that referenced this pull request Aug 19, 2019
Before this commit it was using a tagged union to store the one-byte and
two-byte pointers.

From a `sizeof(UnionBytes)` perspective that makes no difference - there
is a hole between the tag and the union - and it makes the code just a
little harder to reason about, IMO.

PR-URL: #29116
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c++ Issues and PRs that require attention from people who are familiar with C++.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants