Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
..
  • Loading branch information
dnfield committed Aug 13, 2020
commit 834417bfe2fc03284411cf549ad552a975e0c34b
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ public static native void nativeInit(
@NonNull String appStoragePath,
@NonNull String engineCachesPath,
long initTimeMillis,
long oldGenHeapSizeBytes);
long oldGenHeapSizeMegaBytes);

/**
* Prefetch the default font manager provided by SkFontMgr::RefDefault() which is a process-wide
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ public void ensureInitializationComplete(
}

ActivityManager activityManager = (ActivityManager)getSystemService(ACTIVITY_SERVICE);
long oldGenHeapSizeBytes = activityManager.getLargeMemoryClass() * 1000000;
long oldGenHeapSizeMegaBytes = activityManager.getLargeMemoryClass();

FlutterJNI.nativeInit(
applicationContext,
Expand All @@ -254,7 +254,7 @@ public void ensureInitializationComplete(
result.appStoragePath,
result.engineCachesPath,
initTimeMillis,
oldGenHeapSizeBytes);
oldGenHeapSizeMegaBytes);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can oldGenHeapSizeMegaBytes be provided as a shell command line flag in shell/common/switches.h?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It could but then we lose some static type checking here. Is there some reason you have in mind to do it that way?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be more consistent with how other engine settings are assigned and would avoid a proliferation of nativeInit arguments

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done


initialized = true;
} catch (Exception e) {
Expand Down