Skip to content

Aligned pointers and pointer reinterpret-cast - #676

Open
paugier wants to merge 10 commits into
spylang:mainfrom
paugier:ptr-align
Open

paugier wants to merge 10 commits into
spylang:mainfrom
paugier:ptr-align

Conversation

@paugier

@paugier paugier commented Sep 7, 2026

Copy link
Copy Markdown
Contributor
  • blue alignof
  • gc_ptr[T, N=alignof(T)]
  • gc_alloc[T, N=alignof(T)]
  • spy_alloc_aligned_impl C helper function
  • load/store with __builtin_memcpy when alignment < alignof(T)
  • cast[DstItemT](ptr)
  • align_cast[N](ptr)
  • align_offset(ptr, N, n)

It seems to me that it reasonable to not include cast functions in this first PR and to focus on the core of the problem.

The principles and the API have been discussed on Discord.

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.

1 participant