Skip to content

fixes #25566; {.align.} pragma where each 16-byte-aligned - #25570

Merged
Araq merged 17 commits into
develfrom
pr_Schatz
Mar 4, 2026
Merged

Araq merged 17 commits into
develfrom
pr_Schatz

Conversation

@ringabout

@ringabout ringabout commented Mar 2, 2026 •

Copy link
Copy Markdown
Member

fixes #25566

Copilot AI review requested due to automatic review settings March 2, 2026 11:13
@ringabout
ringabout marked this pull request as draft March 2, 2026 11:13

This comment was marked as resolved.

@ringabout ringabout changed the title test i386 fixes #25566 Mar 3, 2026
@ringabout
ringabout marked this pull request as ready for review March 3, 2026 09:15
@ringabout ringabout changed the title fixes #25566 fixes #25566; {.align.} pragma where each 16-byte-aligned Mar 3, 2026
Comment thread tests/align/talign2.nim Resolved
@Araq
Araq merged commit 8e2547a into devel Mar 4, 2026
18 checks passed
@Araq
Araq deleted the pr_Schatz branch March 4, 2026 08:14
narimiran pushed a commit that referenced this pull request Mar 4, 2026
@github-actions

github-actions Bot commented Mar 4, 2026

Copy link
Copy Markdown
Contributor

Thanks for your hard work on this PR!
The lines below are statistics of the Nim compiler built from 8e2547a

Hint: mm: orc; opt: speed; options: -d:release
190000 lines; 11.459s; 803.148MiB peakmem

@arnetheduck

Copy link
Copy Markdown
Contributor

why the 16-byte alignment on 32-bit platforms? ie malloc on 32-bit targets typically aligns to 8 (using max_align_t from the C standard to tell) - it just wastes a bit of memory without providing much practical benefit.

What's important with an allocator is that it respects the alignment requirements of the type, not any one random alignment like 16.

@Araq

Araq commented Mar 24, 2026

Copy link
Copy Markdown
Member

Yeah and equally important is to have a "hotfix" in place while we rewrite the entire allocator because alignment is a bitch.

@arnetheduck

Copy link
Copy Markdown
Contributor

Yeah and equally important is to have a "hotfix" in place while we rewrite the entire allocator because alignment is a bitch.

The alternative here is to roll back the attempt at implementing alignment, ie align: 16 never worked on 32-bit before either (or any other alignment for that matter). Supporting align is only useful if it works for all settings of align.

@Araq

Araq commented Mar 24, 2026 •

Copy link
Copy Markdown
Member

How so? No codebase uses "all settings of align", there are only a handful values that are used in practice.

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.

Regression from v2.2.6 to v2.2.8 and also devel in refc {.align.} pragma where each 16-byte-aligned heap objects gets its own page

4 participants