The source project of this merge request has been removed.
Avoid snapshotting PathMaps when it is unneeded
Previously, PathMaps were always replaced by a snapshot before modification, even if that meant instantly discarding the original because it was not used anywhere else.
Avoid doing unneeded copies and GC work by maintaining a shared flag on PathMaps to keep track of whether the PathMap is used more than once, and using that flag to decide whether a snapshot is mandatory.
Also make the Pathmap interface more consistent by always using (pm *PathMap) instead of sometimes (pm PathMap).