JuliaCollections / DataStructures.jl

Julia implementation of Data structures
https://juliacollections.github.io/DataStructures.jl/latest/
MIT License
679 stars 242 forks source link

stackoverflow on comparisons for long linked lists #878

Open arikheinss opened 8 months ago

arikheinss commented 8 months ago

== comparisons for linked lists use recursive implementation. Since julia does, as of now, not support tail call optimization, this will lead to stack overflow errors for long lists. To reproduce try this:

using DataStructures
l = nil(Float64)
n = 100_000
for i in 1:n
    l = cons(rand(), l)
end

l2 = copy(l);

# this will crash
l == l2