Author here, open for questions :)
I only know these things from clojure on the jvm. How do you implement these without Garbage Collection, since freeing the wrong memory in one version could spell disaster for another version of the structure due to structural sharing.
However, this can be customized in the library. There is a brief description here: https://sinusoid.es/immer/memory.html
For example, one may choose between thread safe or thread unsafe reference counting (the later is much faster!). One may also plug in a conservative garbage collector, like `libgc` (https://github.com/ivmai/bdwgc). While reference counting is often considered to be bad for immutable data structures, I found out that this is not the case. They have very interesting interactions with move semantics and _transients_ (this is a feature that is still on the design phase though). I should write more about this somewhere, maybe in a blog or even as a paper.