[[no_unique_address]] to compact Triangulation_ds_full_cell #8045
+4
−2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary of Changes
When using the mirror policy,
combinatorics_
ends with an array of dim+1int8_t
, and Triangulation_ds_full_cell wants to store anunsigned char
after that. It seems natural for it to end up right after the array, however that's not what the Itanium ABI (used everywhere but windows) does, it leaves the padding at the end ofcombinatorics_
alone and puts the extra member after that. IfCombinatorics
was a base class, reusing those padding bytes would work. With this ABI,[[no_unique_address]]
precisely means to pretend that it is a base class, for the purpose of layout. I admit this is not the most common use for this attribute...With this change, it becomes tempting to make the mirror-index policy the default for static dimensions. Unless the user adds cell data that would perfectly fit the padding after
tds_data
but would not fit anymore with the mirror indexes (not that far-fetched, I didn't check but that should be the case if the user data isint
and the dimension is 3), the mirror indexes come for free (storage-wise) up to dimension 6, and at the cost of one extra (size of) pointer per full cell for dimensions 7 to 14. Maybe in a later PR...Release Management