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

Add design doc for zerovec #1537

Merged
merged 13 commits into from
Jan 29, 2022
Merged

Conversation

Manishearth
Copy link
Member

Progress towards #1475

I haven't done a final pass but I think this is ready for review to at least start.

@Manishearth Manishearth requested a review from sffc as a code owner January 25, 2022 09:41
Copy link
Member

@sffc sffc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Halfway through

utils/zerovec/design_doc.md Outdated Show resolved Hide resolved
utils/zerovec/design_doc.md Outdated Show resolved Hide resolved
utils/zerovec/design_doc.md Outdated Show resolved Hide resolved
utils/zerovec/design_doc.md Outdated Show resolved Hide resolved
utils/zerovec/design_doc.md Outdated Show resolved Hide resolved
Manishearth and others added 5 commits January 28, 2022 14:20
Co-authored-by: Shane F. Carr <shane@unicode.org>
Co-authored-by: Shane F. Carr <shane@unicode.org>
Co-authored-by: Shane F. Carr <shane@unicode.org>
Co-authored-by: Shane F. Carr <shane@unicode.org>
Co-authored-by: Shane F. Carr <shane@unicode.org>
utils/zerovec/design_doc.md Outdated Show resolved Hide resolved
utils/zerovec/design_doc.md Outdated Show resolved Hide resolved

These can only be applied to structs where all fields are ULE types (for `#[derive(VarULE)]`, the last field must be an unsized `VarULE` type). These derives will do the following things:

- Apply `#[repr(packed)]` to the type
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If all fields are ULE then it doesn't need #[repr(packed)], right?

Copy link
Member Author

@Manishearth Manishearth Jan 28, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, it still needs it, repr(Rust) is not stable or defined

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does repr(C) produce the same result as repr(packed) on types with ULE fields?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure.... maybe? It's worth looking in to. It would certainly make some things easier since rust has restrictions on packed types.

utils/zerovec/design_doc.md Show resolved Hide resolved
utils/zerovec/design_doc.md Outdated Show resolved Hide resolved
utils/zerovec/design_doc.md Outdated Show resolved Hide resolved
Manishearth and others added 4 commits January 28, 2022 14:50
Co-authored-by: Shane F. Carr <shane@unicode.org>
Co-authored-by: Shane F. Carr <shane@unicode.org>
Co-authored-by: Shane F. Carr <shane@unicode.org>
@Manishearth Manishearth requested a review from sffc January 28, 2022 22:55
sffc
sffc previously approved these changes Jan 28, 2022
utils/zerovec/design_doc.md Outdated Show resolved Hide resolved
Co-authored-by: Shane F. Carr <shane@unicode.org>
@Manishearth Manishearth merged commit ededcd2 into unicode-org:main Jan 29, 2022
@Manishearth Manishearth deleted the zerovec-design branch January 29, 2022 02:17
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.

2 participants