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

[[no_unique_address]] to compact Triangulation_ds_full_cell #8045

Merged
merged 2 commits into from
Feb 28, 2024

Conversation

mglisse
Copy link
Member

@mglisse mglisse commented Feb 24, 2024

Summary of Changes

When using the mirror policy, combinatorics_ ends with an array of dim+1 int8_t, and Triangulation_ds_full_cell wants to store an unsigned 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 of combinatorics_ alone and puts the extra member after that. If Combinatorics 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 is int 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

  • Affected package(s): Triangulation

@mglisse

This comment was marked as outdated.

@sloriot
Copy link
Member

sloriot commented Feb 28, 2024

Successfully tested in CGAL-6.0-Ic-181

@lrineau lrineau self-assigned this Feb 28, 2024
@lrineau lrineau added the rm only: ready for master For the release team only: that indicates that a PR is about to be merged in 'master' label Feb 28, 2024
@lrineau lrineau merged commit 7767510 into CGAL:master Feb 28, 2024
9 checks passed
@lrineau lrineau removed the rm only: ready for master For the release team only: that indicates that a PR is about to be merged in 'master' label Feb 28, 2024
@lrineau lrineau deleted the Triangulation-full_cell-glisse branch February 28, 2024 10:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants