Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
sxychenjing
engine
提交
fa33c76e
E
engine
项目概览
sxychenjing
/
engine
与 Fork 源项目一致
从无法访问的项目Fork
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
E
engine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
fa33c76e
编写于
9月 18, 2020
作者:
D
Dan Field
提交者:
GitHub
9月 18, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
set old_gen_heap_size to half of available memory on iOS (#20472)
上级
aec855d3
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
33 addition
and
4 deletion
+33
-4
ci/licenses_golden/licenses_flutter
ci/licenses_golden/licenses_flutter
+1
-0
common/constants.h
common/constants.h
+7
-0
flow/raster_cache.cc
flow/raster_cache.cc
+4
-4
shell/platform/darwin/ios/framework/Source/FlutterDartProject.mm
...latform/darwin/ios/framework/Source/FlutterDartProject.mm
+11
-0
shell/platform/darwin/ios/framework/Source/FlutterDartProjectTest.mm
...orm/darwin/ios/framework/Source/FlutterDartProjectTest.mm
+10
-0
未找到文件。
ci/licenses_golden/licenses_flutter
浏览文件 @
fa33c76e
...
...
@@ -19,6 +19,7 @@ FILE: ../../../flutter/assets/directory_asset_bundle.cc
FILE: ../../../flutter/assets/directory_asset_bundle.h
FILE: ../../../flutter/benchmarking/benchmarking.cc
FILE: ../../../flutter/benchmarking/benchmarking.h
FILE: ../../../flutter/common/constants.h
FILE: ../../../flutter/common/exported_symbols.sym
FILE: ../../../flutter/common/settings.cc
FILE: ../../../flutter/common/settings.h
...
...
common/constants.h
0 → 100644
浏览文件 @
fa33c76e
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
namespace
flutter
{
constexpr
double
kMegaByteSizeInBytes
=
(
1
<<
20
);
}
// namespace flutter
flow/raster_cache.cc
浏览文件 @
fa33c76e
...
...
@@ -6,6 +6,7 @@
#include <vector>
#include "flutter/common/constants.h"
#include "flutter/flow/layers/layer.h"
#include "flutter/flow/paint_utils.h"
#include "flutter/fml/logging.h"
...
...
@@ -298,12 +299,11 @@ void RasterCache::SetCheckboardCacheImages(bool checkerboard) {
void
RasterCache
::
TraceStatsToTimeline
()
const
{
#if !FLUTTER_RELEASE
constexpr
double
kMegaBytes
=
(
1
<<
20
);
FML_TRACE_COUNTER
(
"flutter"
,
"RasterCache"
,
reinterpret_cast
<
int64_t
>
(
this
),
"LayerCount"
,
layer_cache_
.
size
(),
"LayerMBytes"
,
EstimateLayerCacheByteSize
()
/
kMegaByte
s
,
"PictureCount"
,
picture_cache_
.
size
(),
"PictureMBytes"
,
EstimatePictureCacheByteSize
()
/
kMegaBytes
);
EstimateLayerCacheByteSize
()
/
kMegaByte
SizeInBytes
,
"PictureCount"
,
picture_cache_
.
size
(),
"PictureMBytes"
,
EstimatePictureCacheByteSize
()
/
kMegaByte
SizeInByte
s
);
#endif // !FLUTTER_RELEASE
}
...
...
shell/platform/darwin/ios/framework/Source/FlutterDartProject.mm
浏览文件 @
fa33c76e
...
...
@@ -6,6 +6,7 @@
#import "flutter/shell/platform/darwin/ios/framework/Source/FlutterDartProject_Internal.h"
#include "flutter/common/constants.h"
#include "flutter/common/task_runners.h"
#include "flutter/fml/mapping.h"
#include "flutter/fml/message_loop.h"
...
...
@@ -151,6 +152,16 @@ static flutter::Settings DefaultSettingsForProcess(NSBundle* bundle = nil) {
make_mapping_callback
(
kPlatformStrongDill
,
kPlatformStrongDillSize
);
#endif // FLUTTER_RUNTIME_MODE == FLUTTER_RUNTIME_MODE_DEBUG
// If we even support setting this e.g. from the command line or the plist,
// we should let the user override it.
// Otherwise, we want to set this to a value that will avoid having the OS
// kill us. On most iOS devices, that happens somewhere near half
// the available memory.
// The VM expects this value to be in megabytes.
if
(
settings
.
old_gen_heap_size
<=
0
)
{
settings
.
old_gen_heap_size
=
std
::
round
([
NSProcessInfo
processInfo
].
physicalMemory
*
.48
/
flutter
::
kMegaByteSizeInBytes
);
}
return
settings
;
}
...
...
shell/platform/darwin/ios/framework/Source/FlutterDartProjectTest.mm
浏览文件 @
fa33c76e
...
...
@@ -2,8 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#import <OCMock/OCMock.h>
#import <XCTest/XCTest.h>
#include "flutter/common/constants.h"
#include "flutter/shell/platform/darwin/common/framework/Headers/FlutterMacros.h"
#import "flutter/shell/platform/darwin/ios/framework/Source/FlutterDartProject_Internal.h"
FLUTTER_ASSERT_ARC
...
...
@@ -19,6 +22,13 @@ FLUTTER_ASSERT_ARC
-
(
void
)
tearDown
{
}
-
(
void
)
testOldGenHeapSizeSetting
{
FlutterDartProject
*
project
=
[[
FlutterDartProject
alloc
]
init
];
int64_t
old_gen_heap_size
=
std
::
round
([
NSProcessInfo
processInfo
].
physicalMemory
*
.48
/
flutter
::
kMegaByteSizeInBytes
);
XCTAssertEqual
(
project
.
settings
.
old_gen_heap_size
,
old_gen_heap_size
);
}
-
(
void
)
testMainBundleSettingsAreCorrectlyParsed
{
NSBundle
*
mainBundle
=
[
NSBundle
mainBundle
];
NSDictionary
*
appTransportSecurity
=
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录