From a46d8bce3735804c6d288449e2bcc8b889b192e5 Mon Sep 17 00:00:00 2001 From: "Justin C. Miller" Date: Mon, 20 Feb 2023 11:36:36 -0800 Subject: [PATCH] [libc] Mark cast_to as always_inline I've seen the compiler emit a call to cast_to, which it should never do. --- src/libraries/libc/__j6libc/casts.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/libraries/libc/__j6libc/casts.h b/src/libraries/libc/__j6libc/casts.h index 5352bee..2bd5c9a 100644 --- a/src/libraries/libc/__j6libc/casts.h +++ b/src/libraries/libc/__j6libc/casts.h @@ -31,6 +31,7 @@ inline T cast_to(S p) { return reinterpret_cast(p); } */ template +__attribute__ ((always_inline)) inline T cast_to(S p) { return reinterpret_cast(const_cast::type>(p)); }