Cleanup ios_hermes:rn_heap_size_mb (#43023)

Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43023

Unused mobile config, and is not consistently used across all the many places we can initialize a Hermes instance.

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D53761942

fbshipit-source-id: a3e1adae87e41142c337a27b33750f82774cf92c
This commit is contained in:
Pieter De Baets
2024-02-20 14:44:59 -08:00
committed by Facebook GitHub Bot
parent 916dde4c60
commit b164302bf6
@@ -148,18 +148,11 @@ std::unique_ptr<JSRuntime> HermesInstance::createJSRuntime(
? reactNativeConfig->getInt64("ios_hermes:vm_experiment_flags")
: 0;
int64_t heapSizeConfig = reactNativeConfig
? reactNativeConfig->getInt64("ios_hermes:rn_heap_size_mb")
: 0;
// Default to 3GB if MobileConfigs is not available
auto heapSizeMB = heapSizeConfig > 0
? static_cast<::hermes::vm::gcheapsize_t>(heapSizeConfig)
: 3072;
::hermes::vm::RuntimeConfig::Builder runtimeConfigBuilder =
::hermes::vm::RuntimeConfig::Builder()
.withGCConfig(::hermes::vm::GCConfig::Builder()
.withMaxHeapSize(heapSizeMB << 20)
// Default to 3GB
.withMaxHeapSize(3072 << 20)
.withName("RNBridgeless")
// For the next two arguments: avoid GC before TTI
// by initializing the runtime to allocate directly