[PATCH] D73143: [scudo][standalone] Reduce Android region sizes to 128MB

Kostya Kortchinsky via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 21 14:41:52 PST 2020


cryptoad created this revision.
cryptoad added reviewers: cferris, eugenis, hctim, morehouse, pcc.
Herald added projects: Sanitizers, LLVM.
Herald added a subscriber: Sanitizers.

Unity is making irresponsible assumptions as to how clumped up memory
should be. With larger regions, we break those, resulting in errors
like:

"Using memoryadresses from more that 16GB of memory"

This is unfortunately one of those situations where we have to bend to
existing code because we doubt it's going to change any time soon.

128MB should be enough, but we could be flirting with OOMs in the
higher class sizes.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D73143

Files:
  compiler-rt/lib/scudo/standalone/allocator_config.h


Index: compiler-rt/lib/scudo/standalone/allocator_config.h
===================================================================
--- compiler-rt/lib/scudo/standalone/allocator_config.h
+++ compiler-rt/lib/scudo/standalone/allocator_config.h
@@ -39,8 +39,8 @@
 struct AndroidConfig {
   using SizeClassMap = AndroidSizeClassMap;
 #if SCUDO_CAN_USE_PRIMARY64
-  // 1GB regions
-  typedef SizeClassAllocator64<SizeClassMap, 30U,
+  // 128MB regions
+  typedef SizeClassAllocator64<SizeClassMap, 27U,
                                /*MaySupportMemoryTagging=*/true>
       Primary;
 #else
@@ -55,8 +55,8 @@
 struct AndroidSvelteConfig {
   using SizeClassMap = SvelteSizeClassMap;
 #if SCUDO_CAN_USE_PRIMARY64
-  // 512MB regions
-  typedef SizeClassAllocator64<SizeClassMap, 29U> Primary;
+  // 128MB regions
+  typedef SizeClassAllocator64<SizeClassMap, 27U> Primary;
 #else
   // 64KB regions
   typedef SizeClassAllocator32<SizeClassMap, 16U> Primary;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D73143.239436.patch
Type: text/x-patch
Size: 951 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200121/8a9cf789/attachment.bin>


More information about the llvm-commits mailing list