The main motivation for this is that building error messages via string
concatenation is tedious and makes it hard to judge what the actual message
looks like when there are a lot of parts being inserted, to the extent that
I've been tempted to leave out some potentially useful information because the
code was getting unwieldy.
It also has some small functional benefits: bools are printed as true/false
rather than 1/0, and it is optimized for minimizing the compiled size.
Currently it cuts ~30 KB off librealm-object-store.dylib even with the addition
of new functionality.
`Realm`, and moving from a `Results` to not result in a use-after-free.
The compiler generated move-assignment operator resulted in `m_notifier`
being assigned to without first calling `CollectionNotifier::unregister`.
This left a retain cycle in place, causing the `Realm` and other objects
to leak.
`ResultsNotifier` keeps track of which `Results` it should update when a
new `TableView` becomes available. When `Results` move-assignment
operator and move-constructor transfer ownership of the
`ResultsNotifier` to a new instance they also need to update its target
so it won't attempt to update the moved-from `Results`.
File::AccessError is now thrown for all file-related exceptions which don't
have more specific types (rather than std::runtime_error), which requires some
changes to how exception messages are built when translating them to get nice
results.
Also add `Realm::write_copy()` which just wraps `Group::write()` with error
translation.
Skip doing any checking at all if none of the tables reachable from the root
table have been modified (which can happen if the table version was bumped due
to insertions, unrelated backlinks, or unlinked-to rows being deleted in linked
tables).
Add cycle checking rather than relying on the max depth to handle it, as the
worst case was O(N^16) if the cycle involved a LinkList of size N.
Track which rows have been confirmed to have not been modified.
Cache the information about the links for each of the relevant tables as
checking the table schema can get somewhat expensive.
If there are multiple Realm instances for a single file on a single thread due
to disabling caching we need to actually deliver the results to the appropriate
SharedGroup for each notifier rather than delivering them all to the first one.
Switch to a chunked vector-of-vectors which makes mid-insertions on large sets
much faster, and cache the begin/end/count for each chunk to make lookups much
more cache-friendly.
Deliver the initial results for both of them and include the changeset
in the initial delivery for both, rather than having them behave weirdly
differently.
Make lcov/gcovr an optional dependency that's only needed for Coverage
configurations, remove some pointless noisy messages when not generating
coverage, and generally simplify the whole thing.