FastLED 3.9.15
Loading...
Searching...
No Matches

◆ assume_aligned() [2/2]

template<fl::size_t N, typename T>
T * fl::assume_aligned ( T * ptr)
inline

Definition at line 126 of file align.h.

126 {
127#if defined(FL_IS_AVR)
128 return ptr;
129#elif defined(FL_IS_CLANG) || defined(FL_IS_GCC)
130 return static_cast<T *>(__builtin_assume_aligned(ptr, N));
131#elif defined(FL_IS_WIN_MSVC)
132 // MSVC: __assume tells the optimizer the pointer is N-byte aligned.
133 // No __builtin_assume_aligned equivalent exists on MSVC.
134 __assume(((char *)ptr - (char *)0) % N == 0);
135 return ptr;
136#else
137 return ptr;
138#endif
139}

References FL_NOEXCEPT.

Referenced by fl::aligned_ptr< T, N >::aligned_ptr(), and fl::aligned_ptr< T, N >::get().

+ Here is the caller graph for this function: