Bug 1291356 - Ensure building with --with-servo keeps building with mozjemalloc, whatever the default jemalloc is. r?chmanchester draft
authorMike Hommey <mh+mozilla@glandium.org>
Fri, 26 Aug 2016 10:28:04 +0900
changeset 405868 55b177dea806ba2a2d2d4a28f2b02b0b9e028199
parent 405719 0238732bceb1be76e050ad170aa008c89fef3e83
child 406083 641fe5dd1c315697583b7c6cae55d7aabebd3154
push id27580
push userbmo:mh+mozilla@glandium.org
push dateFri, 26 Aug 2016 01:30:51 +0000
reviewerschmanchester
bugs1291356
milestone51.0a1
Bug 1291356 - Ensure building with --with-servo keeps building with mozjemalloc, whatever the default jemalloc is. r?chmanchester
build/moz.configure/memory.configure
toolkit/moz.configure
--- a/build/moz.configure/memory.configure
+++ b/build/moz.configure/memory.configure
@@ -4,17 +4,17 @@
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 
 option(env='MOZ_JEMALLOC4', help='Enable jemalloc 4')
 imply_option('--enable-jemalloc', depends_if('MOZ_JEMALLOC4')(lambda x: '4'))
 
 
-option('--enable-jemalloc', nargs='?', choices=('4',), env='MOZ_MEMORY',
+option('--enable-jemalloc', nargs='?', choices=('4', 'moz'), env='MOZ_MEMORY',
        help='Replace memory allocator with jemalloc')
 
 @depends('--enable-jemalloc', target, build_project, c_compiler)
 def jemalloc(value, target, build_project, c_compiler):
     if value.origin != 'default':
         return bool(value) or None
 
     if build_project == 'js':
--- a/toolkit/moz.configure
+++ b/toolkit/moz.configure
@@ -490,16 +490,18 @@ option('--with-servo', env='SERVO_TARGET
             'be found. This is generally servo_src_dir/target/release.'
             'Passing this flag enables experimental integration with the '
             'servo style system')
 
 @depends_if('--with-servo')
 def servo_target_dir(value):
     return value[0]
 
+imply_option('--enable-jemalloc', depends_if('--with-servo')(lambda _: 'moz'))
+
 set_define('MOZ_STYLO', depends_if(servo_target_dir)(lambda x: bool(x)))
 set_config('SERVO_TARGET_DIR', servo_target_dir)
 
 # Gecko integrated IPC fuzzer
 # ==============================================================
 option('--enable-ipc-fuzzer', env='MOZ_FAULTY',
        help='Enable IPC fuzzer')