Skip to content

Commit

Permalink
Revert "Move default Hermes GC config from ReactAndroid to ReactCommon"
Browse files Browse the repository at this point in the history
This reverts commit d009c5a.
  • Loading branch information
Ashoat committed Aug 6, 2021
1 parent 404613b commit 86773fc
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 39 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
*/

#include <../instrumentation/HermesMemoryDumper.h>
#include <DefaultHermesGCConfigBuilder-inl.h>
#include <HermesExecutorFactory.h>
#include <android/log.h>
#include <fbjni/fbjni.h>
Expand All @@ -32,8 +31,22 @@ static void hermesFatalHandler(const std::string &reason) {
static std::once_flag flag;

static ::hermes::vm::RuntimeConfig makeRuntimeConfig(jlong heapSizeMB) {
return ::hermes::vm::RuntimeConfig::Builder()
.withGCConfig(defaultHermesGCConfigBuilder(heapSizeMB).build())
namespace vm = ::hermes::vm;
auto gcConfigBuilder =
vm::GCConfig::Builder()
.withName("RN")
// For the next two arguments: avoid GC before TTI by initializing the
// runtime to allocate directly in the old generation, but revert to
// normal operation when we reach the (first) TTI point.
.withAllocInYoung(false)
.withRevertToYGAtTTI(true);

if (heapSizeMB > 0) {
gcConfigBuilder.withMaxHeapSize(heapSizeMB << 20);
}

return vm::RuntimeConfig::Builder()
.withGCConfig(gcConfigBuilder.build())
.build();
}

Expand Down
36 changes: 0 additions & 36 deletions ReactCommon/hermes/executor/DefaultHermesGCConfigBuilder-inl.h

This file was deleted.

0 comments on commit 86773fc

Please sign in to comment.