HackerTrans
TopNewTrendsCommentsPastAskShowJobs

weissi

no profile record

comments

weissi
·قبل 13 يومًا·discuss
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.