Comment by masklinn
5 days ago
As far as I understand, every change to indirections (pointers) is “shape unstable”, as it the update invalidates the old value, which causes every reference into that to be dangling (rather than merely modified).
Adding a new node at the end of a linked list, or more generally setting an unset pointer, would technically be shape-stable as you can’t have a reference into nothing. Generally pushing an element in a dynamic array is not shape-stable (the array can need to reallocate), although there would be workarounds e.g. a push which fails on lack of capacity would be shape-stable. Some sort of hybrid (e.g. rrb) would also work as extension consists of adding new node (possibly re-rooting the tree) but does not invalidate existing nodes.
No comments yet
Contribute on Hacker News ↗