4 ms·
In C++ there is the align_alloc specificier. https://en.cppreference.com/w/c/memory/aligned_alloc https://en.cppreference.com/w/c/memory/aligned_alloc Not sure
by wayoverthecloud 2y ago
In C++ there is the align_alloc specificier. https://en.cppreference.com/w/c/memory/aligned_alloc https://en.cppreference.com/w/c/memory/aligned_alloc
Not sure for C
- ryanpetrich 2y agoaligned_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 2y agoThe compiler is allowed to assume the results of malloc and certain other allocation functions do not alias. Restrict does too.