Skip to content

⚡ Fix the size of tuples of empty objects#332

Merged
bdeane-intel merged 2 commits intointel:mainfrom
elbeno:tuple-empty-size
Mar 2, 2026
Merged

⚡ Fix the size of tuples of empty objects#332
bdeane-intel merged 2 commits intointel:mainfrom
elbeno:tuple-empty-size

Conversation

@elbeno
Copy link
Contributor

@elbeno elbeno commented Mar 2, 2026

Problem:

  • A tuple containing distinct empty objects requires at least 1 byte for each, when it could be 1 byte total.

Solution:

  • Apply [[no_unique_address]] to tuple elements so that a tuple of empty objects is minimal.

Problem:
- `REQUIRE`, aborts a test when it fails. This mostly not what is intended when
  using `STATIC_REQUIRE`.

Solution:
- Use `STATIC_CHECK` instead of `STATIC_REQUIRE`.
@elbeno elbeno force-pushed the tuple-empty-size branch from 4e91fa0 to 3afbd03 Compare March 2, 2026 20:34
Problem:
- A tuple containing distinct empty objects requires at least 1 byte for each, when it
  could be 1 byte total.

Solution:
- Apply `[[no_unique_address]]` to tuple elements so that a tuple of empty
  objects is minimal.
@bdeane-intel bdeane-intel merged commit d367754 into intel:main Mar 2, 2026
50 checks passed
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.

3 participants