arximboldi / immer

Postmodern immutable and persistent data structures for C++ — value semantics at scale
https://sinusoid.es/immer
Boost Software License 1.0
2.51k stars 185 forks source link

Add missed clear to unsafe_free_list_storage #294

Open jj683 opened 1 month ago

jj683 commented 1 month ago

We encountered different behavior of thread_local_free_list_heap and unsafe_free_list_heap data structures even when used in the single thread environment.

Unfortunately I am still in the process of building a small test to reproduce it, but while reading the code I noticed that the clear function is not called for unsafe_free_list_storage similarly to the thread_local_free_list_storage container. Is this expected behavior?

arximboldi commented 1 month ago

Hmmmm interesting.

I think my reasoning here is as follows:

With these assumptions the current code was correct. But maybe you were using the code in some way that negates some of the assumptions? What prompted you to make these changes?