Skip to content

Commit

Permalink
Avoid copying args (#4629)
Browse files Browse the repository at this point in the history
  • Loading branch information
kraenhansen committed Jul 7, 2022
1 parent bcfb93d commit 4709a2b
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 10 deletions.
35 changes: 29 additions & 6 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
10.19.5 Release notes (2022-7-6)
x.x.x Release notes (yyyy-MM-dd)
=============================================================
### Notes
Based on Realm JS v10.17.0: See changelog below for details on enhancements and fixes introduced between this and the previous pre release (which was based on Realm JS v10.16.0).
Based on Realm JS v10.19.5: See changelog below for details on enhancements and fixes introduced between this and the previous pre release (which was based on Realm JS v10.17.0).

### Breaking change
* Removed all code related to the legacy Chrome Debugger. Please use [Flipper](https://fbflipper.com/) as debugger.
Expand Down Expand Up @@ -32,6 +32,30 @@ realm.write(() => {
});
```

### Fixed
* Fixed build error (call to implicitly-deleted copy constructor of 'realm::js::RealmClass<realm::js::realmjsi::Types>::Arguments') (follow up to [#4568](https://github.com/realm/realm-js/pull/4568))

### Compatibility
* Atlas App Services.
* Realm Studio v12.0.0.
* APIs are backwards compatible with all previous releases of Realm JavaScript in the 10.5.x series.
* File format: generates Realms with format v22 (reads and upgrades file format v5 or later for non-synced Realm, upgrades file format v10 or later for synced Realms).

### Internal
* Remove the previous implementation to the JavaScriptCore engine (in `src/jsc`).
* Upgrade Example to RN v0.68.2
* Upgrade dependencies of the Realm Web integration tests
* Throw instances of `Error` instead of plain objects on app errors.
* Make integration tests on React Native Android connect to host machine by default
<!-- * Either mention core version or upgrade -->
<!-- * Using Realm Core vX.Y.Z -->
<!-- * Upgraded Realm Core from vX.Y.Z to vA.B.C -->

10.19.5 Release notes (2022-7-6)
=============================================================
### Enhancements
* None.

### Fixed
* Fixed inadvertent change to minimum Android Gradle plugin version ([#4706](https://github.com/realm/realm-js/issues/4706), since v10.19.4)

Expand All @@ -42,9 +66,9 @@ realm.write(() => {
* File format: generates Realms with format v22 (reads and upgrades file format v5 or later for non-synced Realm, upgrades file format v10 or later for synced Realms).

### Internal
* <Either mention core version or upgrade>
* <Using Realm Core vX.Y.Z>
* <Upgraded Realm Core from vX.Y.Z to vA.B.C>
<!-- * Either mention core version or upgrade -->
<!-- * Using Realm Core vX.Y.Z -->
<!-- * Upgraded Realm Core from vX.Y.Z to vA.B.C -->

10.19.4 Release notes (2022-7-5)
=============================================================
Expand Down Expand Up @@ -108,7 +132,6 @@ realm.write(() => {
* File format: generates Realms with format v22 (reads and upgrades file format v5 or later for non-synced Realm, upgrades file format v10 or later for synced Realms).

### Internal
* Remove the previous implementation to the JavaScriptCore engine (in `src/jsc`).
* Upgrade Example to RN v0.68.2
* Upgrade dependencies of the Realm Web integration tests
* Throw instances of `Error` instead of plain objects on app errors.
Expand Down
8 changes: 4 additions & 4 deletions src/js_realm.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1165,10 +1165,10 @@ void RealmClass<T>::async_open_realm(ContextType ctx, ObjectType this_object, Ar
Function<T>::callback(protected_ctx, protected_callback, protected_this, 1, callback_arguments);
}

std::shared_ptr<AsyncOpenTask> task;
task = Realm::get_synchronized_realm(config);
std::shared_ptr<AsyncOpenTask> task = Realm::get_synchronized_realm(config);

realm::util::EventLoopDispatcher<RealmCallbackHandler> callback_handler([=, defaults = std::move(defaults),
realm::util::EventLoopDispatcher<RealmCallbackHandler> callback_handler([=, args_count = args.count,
defaults = std::move(defaults),
constructors = std::move(constructors)](
ThreadSafeReference&& realm_ref,
std::exception_ptr error) {
Expand Down Expand Up @@ -1200,7 +1200,7 @@ void RealmClass<T>::async_open_realm(ContextType ctx, ObjectType this_object, Ar

try {
ValueType unprotected_args = protected_args;
handle_initial_subscriptions(protected_ctx, args.count - 1, &unprotected_args, realm, realm_exists);
handle_initial_subscriptions(protected_ctx, args_count - 1, &unprotected_args, realm, realm_exists);
}
catch (TypeErrorException e) {
auto error = Object::create_error(ctx, e.what());
Expand Down

0 comments on commit 4709a2b

Please sign in to comment.