Commit Graph

2439 Commits

Author SHA1 Message Date
Thomas Goyne f4e5049f47 Add basic string formatting for error messages
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.
2016-06-03 13:19:42 -07:00
Ari Lazier 49fd092cae Fix for whitespce 2016-06-02 22:05:17 -07:00
Mark Rowe 57ee591809 Merge pull request #78 from realm/mar/weakrealmnotifier-leak
Fix a potential leak within WeakRealmNotifier
2016-06-01 13:07:56 -07:00
Mark Rowe 8685390345 Merge pull request #77 from realm/mar/results-leak
Fix move-assigning to a Results that has a notifier to not leak the Realm
2016-06-01 13:07:45 -07:00
Mark Rowe e2112f8ca5 Merge pull request #81 from realm/mar/core-always-static
Always use core as a static library
2016-06-01 13:07:25 -07:00
Mark Rowe 332813f7f3 Avoid dumping all environment variables when building core without ASan enabled. 2016-06-01 12:20:17 -07:00
Mark Rowe bef0a6ea6e Build core as a static library when building it as a dependency. 2016-06-01 12:19:07 -07:00
Thomas Goyne 6d22d28fea Merge pull request #72 from realm/tg/core-1.0.0
Upgrade to core 1.0.0 and update the file exception translation to match
2016-06-01 12:02:27 -07:00
Mark Rowe 08404d7098 Express `Results`' asignment operators in terms of their equivalent
constructors.

This avoids having to repeat the move constructor's logic in the move
assignment operator, and allows the copy assignment operator to compile
despite `TableViewBase`'s missing copy assignment implementation. the
copy assignment implementation can be defaulted once `TableViewBase` is
fixed.
2016-06-01 11:50:25 -07:00
Mark Rowe 3e952269da Have `Results` default its copy constructor.
The custom implementation was an attempt to ensure that
`m_has_used_table_view` and `m_wants_background_updates` had appropriate
intial values. Thomas pointed out that we can remove the reliance on the
initial values by ensure that `prepare_async` sets
`m_wants_background_updates`, removing the need for a custom copy
constructor.
2016-06-01 11:48:35 -07:00
Mark Rowe fc63c4f67b Merge pull request #76 from realm/mar/fix-building-tests-in-xcode
Fix building tests in Xcode
2016-06-01 11:40:14 -07:00
Mark Rowe 2a75edde8e Move `List`s defaulted constructors and assignment operators out of line. 2016-06-01 11:29:32 -07:00
Scott Kyle d86e3b642e Add new files to Android.mk 2016-06-01 10:14:59 -07:00
Scott Kyle b5853c2590 Merge remote-tracking branch 'object-store/master' into sk-object-store-merge
* object-store/master:
  Make Realm::is_closed() work on read-only instances
  Fix for object store build issues on Android
  Implement commit helper and realm notifier for Android (#69)
  Build both dynamic and static libraries.
  moving pegtl dependency as step 1 in install doc
  update docu (install procedure)
2016-06-01 10:14:16 -07:00
Scott Kyle 30f1c83197 Merge pull request #75 from realm/sk/android-fixes
Fix for object store build issues on Android
2016-06-01 09:43:25 -07:00
Mark Rowe 2c0382661f Merge pull request #467 from realm/mar/avoid-copies
Avoid copying `Object` and `List` instances unnecessarily
2016-05-31 22:24:57 -07:00
Mark Rowe 702b8a31fb Avoid leaking the runloop and source if WeakRealmNotifier is move-assigned. 2016-05-31 21:54:40 -07:00
Mark Rowe 65a748de0c Fix move-assigning to a `Results` that has a notifier to not leak the
`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`.
2016-05-31 19:03:29 -07:00
Mark Rowe 7e99634567 Fix building tests in Xcode.
The Xcode project generated by CMake doesn't create the dylib when built
as the dylib target does not contain any source files. Adding an empty
placeholder .cpp file to the target is sufficient to convince Xcode to
produce the dylib.
2016-05-31 17:16:52 -07:00
Mark Rowe 344fc42d4e Avoid copying `Object` unnecessarily. 2016-05-31 15:54:43 -07:00
Mark Rowe efdf0e01a9 Avoid copying `List` unnecessarily. 2016-05-31 15:27:48 -07:00
Scott Kyle 3b9b8cbc75 Remove unused GCov_Build configuration
We've never really used this, so let's remove it until we ever actually need something like this.
2016-05-31 11:30:24 -07:00
Scott Kyle 385fe97861 Make Realm::is_closed() work on read-only instances 2016-05-31 11:27:39 -07:00
Scott Kyle 7bb8a04359 Fix for object store build issues on Android 2016-05-31 11:11:39 -07:00
Scott Kyle 560e725398 Address some issues in WeakRealmNotifier for Node 2016-05-31 10:05:14 -07:00
Yavor Georgiev 91c87e4de6 Implement commit helper and realm notifier for Android (#69)
* Implement commit helper and realm notifier for Android

* Remove non-existent include

* Shut down the current instance when move-assigning

* Only use Android logging when on Android

* Cleanup realm_ptr when it hasn't been sent over the pipe

* Assed that WeakRealmNotifier is closed on the thread it was created on

* Typo

* Fix syntax error

* changes after code review

* Use the proper preprocessor definition for Android

* Pass the correct address to write(2)

* Explicitly handle looper events

* changes after code review

* Do not return after handling ALOOPER_EVENT_HANGUP

* Handle HANGUP after INPUT
2016-05-31 17:15:32 +02:00
Scott Kyle ba6e83191b Merge pull request #460 from realm/sk-react-native-26
Update projects to React Native 0.26.2
2016-05-27 16:33:44 -07:00
Ari Lazier df040c7d99 fix for comment 2016-05-27 16:25:33 -07:00
Ari Lazier 7829cb5f33 fix for comment 2016-05-27 16:25:33 -07:00
Ari Lazier 38c6eb7b6b more pr feedback 2016-05-27 16:03:03 -07:00
Ari Lazier 3e74cd98d5 more pr feedback 2016-05-27 16:03:03 -07:00
Ari Lazier 9fe636b614 pr feedback 2016-05-27 15:50:33 -07:00
Ari Lazier e316b54eff pr feedback 2016-05-27 15:50:33 -07:00
Ari Lazier 9012549c5d object store pr feedback 2016-05-27 15:45:56 -07:00
Ari Lazier ceceeab9a5 object store pr feedback 2016-05-27 15:45:56 -07:00
Scott Kyle b3ec066d12 Merge pull request #451 from realm/sk-test-improvements
Improve JS tests
2016-05-27 13:56:49 -07:00
Scott Kyle d05542c031 Merge branch 'sk-node-notifier'
* sk-node-notifier:
  Create a HandleScope before calling callbacks
  Add a working WeakRealmNotifier for Node
2016-05-27 13:25:50 -07:00
Scott Kyle 8a52cf8ffe Merge branch 'sk-node-notifier'
* sk-node-notifier:
  Create a HandleScope before calling callbacks
  Add a working WeakRealmNotifier for Node
2016-05-27 13:25:50 -07:00
Scott Kyle 4e457526bb Merge branch 'sk-node-xcode'
* sk-node-xcode:
  Consolidate RealmNode.xcodeproj into RealmJS.xcodeproj
2016-05-27 13:20:01 -07:00
Scott Kyle b76ed20020 Update projects to React Native 0.26.2
Fixed some minor issues along the way.
2016-05-27 11:30:17 -07:00
Scott Kyle 5a3997d268 Fix for consecutive calls to clearTestState()
This bug would only happen from Chrome debug mode, where consecutive calls would crash the app because the m_objects iterator would be in a bad state. This method is faster anyways.
2016-05-26 17:58:24 -07:00
Mark Rowe 78c4f30ee9 Merge pull request #57 from realm/nh/update_doc
update doc (install procedure)
2016-05-26 16:09:30 -07:00
Scott Kyle af70bb3c63 Fix all linting issues inside JS tests 2016-05-26 15:47:30 -07:00
Scott Kyle 846e3b976d Update ESLint dependencies 2016-05-26 15:47:30 -07:00
Scott Kyle aa09ba3cd4 Factor out some common code in React tests
Now iOS and Android share more code. Also converted to using ES6 modules imports and fixed some other linting issues.
2016-05-26 15:47:30 -07:00
Scott Kyle 48394d9c19 Automatically handle deleting test Realms
No longer leave this up to the test. All testing passes through the runTest() function, so we use that spot to delete the Realms. It also now deletes them beforehand too since a crash in a previous run could leave a Realm in place.
2016-05-26 15:47:30 -07:00
Scott Kyle 58bff5f939 Remove commented Objective-C query tests 2016-05-26 15:46:53 -07:00
Scott Kyle 78a8311ba6 Merge branch '0.13.x'
* 0.13.x:
  [0.13.2] Bump version
  fix for upgrading optional date properties
2016-05-26 14:36:17 -07:00
Mark Rowe 0976d1839f Merge pull request #49 from realm/mar/static-library
Build both dynamic and static libraries of the object store
2016-05-26 13:57:01 -07:00
Mark Rowe f19bab76bd Build both dynamic and static libraries.
The dynamic library makes it easy to verify that there are no linker
errors when building the object store, while the static library is
easier for a binding to consume.

This also tweaks how the library targets are defined to ensure that
other CMake projects that pull in the libraries automatically get the
right include paths and link to the appropriate libraries.
2016-05-26 13:41:52 -07:00