From 552c51655626ac28beb8c980d9eaeff67c735bd7 Mon Sep 17 00:00:00 2001 From: Ryan Macnak Date: Mon, 13 Jun 2022 12:28:19 -0700 Subject: [PATCH] Disable compressed pointers on iOS. (flutter/engine#34001) Because we are unable to allocate address space without also allocating memory, even unused portions of the compressed heap make less memory available to all other allocators in the process. The memory savings in the compressed heap will only out-weight the lost memory for other allocations if nearly all of the application's memory usage is in Dart, rather than, say, graphics or plugins. Bug: https://github.com/flutter/flutter/issues/105183 Bug: b/235279083 --- engine/src/flutter/tools/gn | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/engine/src/flutter/tools/gn b/engine/src/flutter/tools/gn index e8d2959da5..0854928a97 100755 --- a/engine/src/flutter/tools/gn +++ b/engine/src/flutter/tools/gn @@ -508,9 +508,10 @@ def to_gn_args(args): sys.exit(1) gn_args['enable_vulkan_validation_layers'] = True - # Enable pointer compression on 64-bit mobile targets. - if args.target_os in ['android', 'ios' - ] and gn_args['target_cpu'] in ['x64', 'arm64']: + # Enable pointer compression on 64-bit mobile targets. iOS is excluded due to + # its inability to allocate address space without allocating memory. + if args.target_os in ['android'] and gn_args['target_cpu'] in ['x64', 'arm64' + ]: gn_args['dart_use_compressed_pointers'] = True if args.fuchsia_target_api_level is not None: