Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Java.Interop] Reduce string allocations from assertions (#55)
Context: https://bugzilla.xamarin.com/show_bug.cgi?id=42476 Bug #42476 notes that the `string.Format()` within the JNI reference count assertions contributes to process memory allocations which the profiler reports, and those generated `strings` are pointless because they're not used unless the assertion fails. This is a fair point, outside of whether or not the assertions should be present at all... Improve the `JniRuntime.JniObjectReferenceManager` JNI reference assertions so that they return early if the assertion wouldn't fire. This avoids the unnecessary string allocation.
- Loading branch information