Maybe it’s some kind of average? @allocated foo() for me always returns either 0 (when returning 1) or 16 (when returning 1.3).
I understand that it allocates due to the uncertain return type, but why only when returning 1.3?
Rounding down because one case was preallocated makes sense. This is what happens for non-Ints, which implies rounding of a fractional bytes estimate that I still don’t really get:
More importantly, does anyone know why there seems to be actually 0 allocations for a similar type-unstable method that doesn’t use rand? Squinting at the @code_llvm suggested to me both methods store 1.3 and 1im as hidden globals.