[libc] Mark cast_to as always_inline

I've seen the compiler emit a call to cast_to, which it should never do.
This commit is contained in:
Justin C. Miller
2023-02-20 11:36:36 -08:00
parent 4052911ac4
commit a46d8bce37

View File

@@ -31,6 +31,7 @@ inline T cast_to(S p) { return reinterpret_cast<T>(p); }
*/
template <typename T, typename S>
__attribute__ ((always_inline))
inline T cast_to(S p) {
return reinterpret_cast<T>(const_cast<typename non_const<S>::type>(p));
}