Skip to content

Commit 9f3d631

Browse files
committed
fix: change the concept to check for external memory pressure properties
1 parent b1afaba commit 9f3d631

3 files changed

Lines changed: 17 additions & 21 deletions

File tree

packages/react-native-executorch/common/rnexecutorch/RnExecutorchInstaller.cpp

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,14 @@ void RnExecutorchInstaller::injectJSIBindings(
2828
RnExecutorchInstaller::loadModel<ImageSegmentation>(
2929
jsiRuntime, jsCallInvoker, "loadImageSegmentation"));
3030

31-
jsiRuntime->global().setProperty(
32-
*jsiRuntime, "loadClassification",
33-
RnExecutorchInstaller::loadModel<Classification>(
34-
jsiRuntime, jsCallInvoker, "loadClassification"));
35-
36-
jsiRuntime->global().setProperty(
37-
*jsiRuntime, "loadExecutorchModule",
38-
RnExecutorchInstaller::loadModel<ExecutorchModule>(
39-
jsiRuntime, jsCallInvoker, "loadExecutorchModule"));
31+
jsiRuntime->global().setProperty(
32+
*jsiRuntime, "loadClassification",
33+
RnExecutorchInstaller::loadModel<Classification>(
34+
jsiRuntime, jsCallInvoker, "loadClassification"));
35+
36+
jsiRuntime->global().setProperty(
37+
*jsiRuntime, "loadExecutorchModule",
38+
RnExecutorchInstaller::loadModel<ExecutorchModule>(
39+
jsiRuntime, jsCallInvoker, "loadExecutorchModule"));
40+
}
4041
} // namespace rnexecutorch

packages/react-native-executorch/common/rnexecutorch/TypeConstraints.h

Lines changed: 0 additions & 12 deletions
This file was deleted.

packages/react-native-executorch/common/rnexecutorch/utils/TypeConstraints.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,11 @@ template <typename T>
2222
concept HasIsLoaded = requires(T t) {
2323
{ &T::isLoaded };
2424
};
25+
26+
template <typename T>
27+
concept UnloadableExternalMemoryAware = requires(T t) {
28+
{ t.unload() } -> std::same_as<void>;
29+
{ t.getMemoryLowerBound() } -> std::same_as<std::size_t>;
30+
};
31+
2532
} // namespace rnexecutorch

0 commit comments

Comments
 (0)