Remove some automatic conversion and comparison #338
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
CxxRef{T}
with one of typeT
. Note that otherRef
types in Julia don't provide such methods either.convert
methods fromSmartPointer
instances to to other types.In both cases, the goal is to avoid invalidations. To give an idea of how bad the removed methods were, consider the number of invalidations as computed with this snippet in a fresh Julia session:
Before this patch, we get 20819 invalidations with Julia 1.8.4, and 13863 with Julia master.
After this patch, this is down to just 2695 in 1.8.4, respectively 1480 in Julia master.
The main issue with this patch is that it may break code relying on these convenience methods. However, the resulting failures should be easy to fix, and the fixed code should work fine with older CxxWrap versions. I would nevertheless suggest to mark this as a breaking change by following the appropriate semver rules.
This makes further progress towards resolving issue #278.
Resolves #313
Closes #334