Skip to content

Comments

Support 8 byte and 16 byte alignment with compact chunk header#21

Merged
lulf merged 6 commits intomainfrom
align-naive
Feb 10, 2026
Merged

Support 8 byte and 16 byte alignment with compact chunk header#21
lulf merged 6 commits intomainfrom
align-naive

Conversation

@lulf
Copy link
Member

@lulf lulf commented Feb 4, 2026

  • Support 8 and 16 byte alignment for headers
  • Chunk header + first part of data is now written together to reduce unnecessary padding for chunks.

lulf added 4 commits January 26, 2026 10:20
Refactors chunk header to pad the chunk after header + data, to
avoid unnecessary padding that is wasteful at 16 byte alignment.
lulf and others added 2 commits February 10, 2026 12:30
Address review feedback:
- Remove repr(align(N)) from MetaHeader and DataHeader
  We only need size to be a multiple of ALIGN, not RAM alignment
- Replace dataheader_padding_align with calc_padding that:
  * Works for any alignment value (including future align-32+)
  * Evaluates to 0 when no padding is needed
  * Doesn't require cfg guards
- Simplify struct initialization by removing cfg attributes

This approach is more maintainable and will work seamlessly
when adding support for higher alignment values.

Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
@lulf lulf added this pull request to the merge queue Feb 10, 2026
Merged via the queue into main with commit 86bb3ea Feb 10, 2026
1 check 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.

2 participants