Just to highlight nsajko’s observation in the issue back here, the results of @timed and thus Revert.@allocate depend on surrounding code, and Base.@allocated is not observed to. It appears so far that involving global variables increases allocations in 1.12, even if the @timed expression only involves local variables and consts:
julia> let b = @timed rand(3); a = b.value; b.bytes end
80
julia> let b = @timed rand(3); global a=b.value; b.bytes end
512
julia> let b = Base.@allocated rand(3); a = b; b end
80
julia> let b = Base.@allocated rand(3); global a = b; b end
80
Both 80 in v1.11.6 and 1.9.4, though a similar effect can be replicated with a nested function outside the @timed expression, and @time can be tried to observe a different allocation discrepancy. Even if it’s worth letting the implementations diverge as they do, it’s not apparent why the reported allocations differ among supposedly equivalent methods and should be hashed out before trying to substituting them with each other. Open to start a different thread if these discrepancies are considered a distraction from the @allocated scoping change.