File tree Expand file tree Collapse file tree 5 files changed +17
-7
lines changed
packages/react-native-reanimated Expand file tree Collapse file tree 5 files changed +17
-7
lines changed Original file line number Diff line number Diff line change 44#include < reanimated/LayoutAnimations/LayoutAnimationsManager.h>
55#include < reanimated/NativeModules/NativeReanimatedModuleSpec.h>
66#include < reanimated/Tools/PlatformDepMethodsHolder.h>
7- #include < reanimated/Tools/SingleInstanceChecker.h>
87
98#ifdef RCT_NEW_ARCH_ENABLED
109#include < reanimated/Fabric/PropsRegistry.h>
1615#include < worklets/NativeModules/NativeWorkletsModule.h>
1716#include < worklets/Registries/EventHandlerRegistry.h>
1817#include < worklets/Tools/JSScheduler.h>
18+ #include < worklets/Tools/SingleInstanceChecker.h>
1919#include < worklets/Tools/UIScheduler.h>
2020
2121#ifdef RCT_NEW_ARCH_ENABLED
@@ -243,8 +243,9 @@ class NativeReanimatedModule : public NativeReanimatedModuleSpec {
243243 const KeyboardEventUnsubscribeFunction unsubscribeFromKeyboardEventsFunction_;
244244
245245#ifndef NDEBUG
246- SingleInstanceChecker<NativeReanimatedModule> singleInstanceChecker_;
247- #endif
246+ worklets::SingleInstanceChecker<NativeReanimatedModule>
247+ singleInstanceChecker_;
248+ #endif // NDEBUG
248249};
249250
250251} // namespace reanimated
Original file line number Diff line number Diff line change 22
33#include < cxxreact/MessageQueueThread.h>
44#include < worklets/NativeModules/NativeWorkletsModuleSpec.h>
5+ #include < worklets/Tools/SingleInstanceChecker.h>
56#include < string>
67
78namespace worklets {
@@ -18,6 +19,9 @@ class NativeWorkletsModule : public NativeWorkletsModuleSpec {
1819
1920 private:
2021 const std::string valueUnpackerCode_;
22+ #ifndef NDEBUG
23+ SingleInstanceChecker<NativeWorkletsModule> singleInstanceChecker_;
24+ #endif // NDEBUG
2125};
2226
2327} // namespace worklets
Original file line number Diff line number Diff line change 55#include < cxxabi.h>
66
77#include < atomic>
8+ #include < cassert>
89#include < iostream>
910#include < string>
1011
1112#ifdef ANDROID
1213#include < android/log.h>
13- #endif
14+ #endif // ANDROID
1415
15- namespace reanimated {
16+ namespace worklets {
1617
1718// This is a class that counts how many instances of a different class there
1819// are. It is meant only to be used with classes that should only have one
@@ -66,6 +67,6 @@ SingleInstanceChecker<T>::~SingleInstanceChecker() {
6667 instanceCount_--;
6768}
6869
69- } // namespace reanimated
70+ } // namespace worklets
7071
7172#endif // NDEBUG
Original file line number Diff line number Diff line change 1414#endif // RCT_NEW_ARCH_ENABLED
1515
1616#import < reanimated/RuntimeDecorators/RNRuntimeDecorator.h>
17- #import < reanimated/Tools/SingleInstanceChecker.h>
1817#import < reanimated/apple/REAModule.h>
1918#import < reanimated/apple/REANodesManager.h>
2019#import < reanimated/apple/REAUIKit.h>
2120#import < reanimated/apple/native/NativeProxy.h>
2221
2322#import < worklets/Tools/ReanimatedJSIUtils.h>
23+ #import < worklets/Tools/SingleInstanceChecker.h>
2424#import < worklets/WorkletRuntime/WorkletRuntime.h>
2525#import < worklets/WorkletRuntime/WorkletRuntimeCollector.h>
2626#import < worklets/apple/WorkletsModule.h>
Original file line number Diff line number Diff line change 11#import < React/RCTBridge+Private.h>
22#import < worklets/WorkletRuntime/RNRuntimeWorkletDecorator.h>
33#import < worklets/apple/WorkletsModule.h>
4+ #import < worklets/tools/SingleInstanceChecker.h>
45
56using worklets::NativeWorkletsModule;
67using worklets::RNRuntimeWorkletDecorator;
@@ -16,6 +17,9 @@ - (void)_tryAndHandleError:(dispatch_block_t)block;
1617
1718@implementation WorkletsModule {
1819 std::shared_ptr<NativeWorkletsModule> nativeWorkletsModule_;
20+ #ifndef NDEBUG
21+ worklets::SingleInstanceChecker<WorkletsModule> singleInstanceChecker_;
22+ #endif // NDEBUG
1923}
2024
2125- (std::shared_ptr<NativeWorkletsModule>)getNativeWorkletsModule
You can’t perform that action at this time.
0 commit comments