HackerTrans
トップ新着トレンドコメント過去質問紹介求人

weissi

no profile record

コメント

weissi
·13 日前·議論
Swift has `@_noAllocation`:

@_noAllocation func foo() -> Int { return [1,2,3].randomElement()! } fails with "error: Using type 'Int' can cause metadata allocation or locks"

but

@_noAllocation func foo() -> Int { return 1 + 2 + 3 }

compiles fine.