Skip to content
Better HN
Top
New
Best
Ask
Show
Jobs
Search
⌘K
undefined | Better HN
0 points
wayoverthecloud
1y ago
0 comments
Share
In C++ there is the align_alloc specificier.
https://en.cppreference.com/w/c/memory/aligned_alloc
Not sure for C
0 comments
default
newest
oldest
ryanpetrich
1y ago
aligned_alloc is a C function. It doesn't help the compiler prove that two pointers can't alias. restrict is the keyword that does.
bobmcnamara
1y ago
The compiler is allowed to assume the results of malloc and certain other allocation functions do not alias.
Restrict does too.
j
/
k
navigate · click thread line to collapse