-
Notifications
You must be signed in to change notification settings - Fork 24.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Extract loading of turbomodulejsijni into its own function (#38320)
Summary: Pull Request resolved: #38320 In this diff I'm extracting the loading of turbomodulejsijni into its own function. This could have perf implications as we are trying to load multimple times the same soLoader changelog: [intenral] internal Reviewed By: luluwu2032 Differential Revision: D47409162 fbshipit-source-id: 007e89e99ec0e7fa494d811f9c830b1363acec19
- Loading branch information
1 parent
1383a59
commit e924685
Showing
7 changed files
with
45 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
...ve/ReactAndroid/src/main/java/com/facebook/react/turbomodule/core/NativeModuleSoLoader.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/* | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
package com.facebook.react.turbomodule.core | ||
|
||
import com.facebook.soloader.SoLoader | ||
|
||
internal class NativeModuleSoLoader { | ||
companion object { | ||
private var isSoLibraryLoaded = false | ||
|
||
@Synchronized | ||
@JvmStatic | ||
fun maybeLoadSoLibrary() { | ||
if (!isSoLibraryLoaded) { | ||
SoLoader.loadLibrary("turbomodulejsijni") | ||
isSoLibraryLoaded = true | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters