Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allocs #856

Merged
merged 2 commits into from
Jun 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/balanced_tree.jl
Original file line number Diff line number Diff line change
Expand Up @@ -242,8 +242,8 @@ function Base.empty!(t::BalancedTree23)
initializeTree!(t.tree)
t.depth = 1
t.rootloc = 1
t.freetreeinds = Vector{Int}()
t.freedatainds = Vector{Int}()
empty!(t.freetreeinds)
empty!(t.freedatainds)
empty!(t.useddatacells)
push!(t.useddatacells, 1, 2)
return nothing
Expand Down
8 changes: 7 additions & 1 deletion test/test_sorted_containers.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2027,6 +2027,12 @@ end



function testSortedAllocs()
d = SortedDict{Int,Int}(Base.Order.ForwardOrdering())
x = @allocated empty!(d)
my_assert(x == 0)
true
end

@testset "SortedContainers" begin
@test testSortedDictBasic()
Expand All @@ -2038,6 +2044,7 @@ end
@test testSortedDictConstructors()
@test testSortedMultiDictConstructors()
@test testTokens()
@test testSortedAllocs()


# test all the errors of sorted containers
Expand Down Expand Up @@ -2109,4 +2116,3 @@ end
end
end
end