# "Nightly" allocates but 1.6 doesn't

**URL:** <https://discourse.julialang.org/t/nightly-allocates-but-1-6-doesnt/64118>\
**Category:** Internals & Design\
**Created:** [July 6, 2021, 1:15am UTC](https://discourse.julialang.org/t/nightly-allocates-but-1-6-doesnt/64118 "2021-07-06T01:15:32Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![cscherrer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cscherrer/32/7631_2.png) [@cscherrer](https://discourse.julialang.org/u/cscherrer)\
**Post date:** [July 6, 2021, 1:15am UTC](https://discourse.julialang.org/t/nightly-allocates-but-1-6-doesnt/64118/1 "2021-07-06T01:15:32Z")

</div>

In [KeywordCalls.jl](https://github.com/cscherrer/KeywordCalls.jl) we have some tests like this:

```julia
 @testset "No Allocation" begin
            @test 0 == @ballocated f(a=1, b=2, c=3)
            @test 0 == @ballocated f((a=1, b=2, c=3))
            @test 0 == @ballocated Foo((b=1,a=2))
            @test 0 == @ballocated g(a=1, b=2)
            @test 0 == @ballocated g((a=1, b=2))
            @test 0 == @ballocated g(a=1, b=2, c=3)
            @test 0 == @ballocated g((a=1, b=2, c=3))
            @test 0 == @ballocated f(alpha=1,b=2,c=3)
            @test 0 == @ballocated g(beta=1, alpha=3)
        end

```

These are passing in 1.6 but failing in the `nightly` build. Details [here](https://github.com/cscherrer/KeywordCalls.jl/runs/2994514715?check_suite_focus=true).

Are others seeing this kind of thing as well? Is it significant, or just a matter of the nightly builds being incomplete?

---

<div class="post-metadata">

**Author:** ![mauro3](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mauro3/32/292_2.png) [@mauro3](https://discourse.julialang.org/u/mauro3)\
**Post date:** [July 6, 2021, 7:11am UTC](https://discourse.julialang.org/t/nightly-allocates-but-1-6-doesnt/64118/2 "2021-07-06T07:11:41Z")

</div>

I would report this. Are they also failing on 1.7-beta?

---

<div class="post-metadata">

**Author:** ![cscherrer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cscherrer/32/7631_2.png) [@cscherrer](https://discourse.julialang.org/u/cscherrer)\
**Post date:** [July 6, 2021, 8:40pm UTC](https://discourse.julialang.org/t/nightly-allocates-but-1-6-doesnt/64118/3 "2021-07-06T20:40:20Z")

</div>

Yes, tests fail on 1.7-beta ☹

---

<div class="post-metadata">

**Author:** ![cscherrer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cscherrer/32/7631_2.png) [@cscherrer](https://discourse.julialang.org/u/cscherrer)\
**Post date:** [July 9, 2021, 1:27pm UTC](https://discourse.julialang.org/t/nightly-allocates-but-1-6-doesnt/64118/4 "2021-07-09T13:27:35Z")

</div>

Update: I opened [this issue](https://github.com/JuliaLang/julia/issues/41488). The only (very small) allocation is here:

```julia
No Allocation: Test Failed at /home/chad/git/KeywordCalls.jl/test/runtests.jl:66
  Expression: 0 == #= /home/chad/git/KeywordCalls.jl/test/runtests.jl:66 =# @ballocated(Foo((b = 1, a = 2)))
   Evaluated: 0 == 32

```

@jeff.bezanson responded,

> This is interesting: `@allocated` gives 0; `@ballocated` gives 32. It can be difficult to exclude 100% of allocations that may happen around testing something.
> 
> Also code\_llvm confirms there are no heap allocations in the generated code.

And @jameson pointed out,

> We changed the `@allocated` macro in v1.7 to attempt to be a bit more reliable and consistent–though possibly not actually a more useful number

I’ll mark this as solved now, please follow the Github issue for more information.
