Bug 1398965 - Fold memory/mozjemalloc into memory/build. r=njn
authorMike Hommey <mh+mozilla@glandium.org>
Thu, 31 Aug 2017 16:43:19 +0900
changeset 380247 77650b2c281280c89b5407d25b56838efb886cad
parent 380246 7da983d6888964b480d02bce7e83dea2b54da672
child 380248 623f813e5a7563a8b5065761324b007f32585d95
push id94856
push userarchaeopteryx@coole-files.de
push dateTue, 12 Sep 2017 09:38:30 +0000
treeherdermozilla-inbound@485c8d248bfc [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnjn
bugs1398965
milestone57.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1398965 - Fold memory/mozjemalloc into memory/build. r=njn The files relevant to the memory allocator are currently spread between memory/mozjemalloc and memory/build, and the distinction was historically from sharing some Mozilla-specific things between mozjemalloc and jemalloc3. That distinction is not useful anymore, so we fold everything together. As we will likely rename the allocator at some point in the future, it is preferable to move away from the mozjemalloc directory rather than in its direction.
dom/html/HTMLInputElement.cpp
js/src/make-source-package.sh
memory/build/Makefile.in
memory/build/moz.build
memory/build/mozjemalloc.cpp
memory/build/mozjemalloc.h
memory/build/mozjemalloc_types.h
memory/build/rb.h
memory/moz.build
memory/mozjemalloc/Makefile.in
memory/mozjemalloc/moz.build
memory/mozjemalloc/mozjemalloc.cpp
memory/mozjemalloc/mozjemalloc.h
memory/mozjemalloc/mozjemalloc_types.h
memory/mozjemalloc/rb.h
toolkit/content/license.html
--- a/dom/html/HTMLInputElement.cpp
+++ b/dom/html/HTMLInputElement.cpp
@@ -1147,17 +1147,17 @@ HTMLInputElement::HTMLInputElement(alrea
   , mNumberControlSpinnerIsSpinning(false)
   , mNumberControlSpinnerSpinsUp(false)
   , mPickerRunning(false)
   , mSelectionCached(true)
   , mIsPreviewEnabled(false)
   , mHasPatternAttribute(false)
 {
   // If size is above 512, mozjemalloc allocates 1kB, see
-  // memory/mozjemalloc/jemalloc.c
+  // memory/build/mozjemalloc.cpp
   static_assert(sizeof(HTMLInputElement) <= 512,
                 "Keep the size of HTMLInputElement under 512 to avoid "
                 "performance regression!");
 
   // We are in a type=text so we now we currenty need a nsTextEditorState.
   mInputData.mState =
     nsTextEditorState::Construct(this, &sCachedTextEditorState);
 
--- a/js/src/make-source-package.sh
+++ b/js/src/make-source-package.sh
@@ -157,17 +157,16 @@ case $cmd in
         ${TOPSRCDIR}/mozglue/moz.build \
         ${tgtpath}/mozglue
     ${MKDIR} -p ${tgtpath}/memory
     cp -pPR \
         ${TOPSRCDIR}/memory/moz.build \
         ${TOPSRCDIR}/memory/build \
         ${TOPSRCDIR}/memory/fallible \
         ${TOPSRCDIR}/memory/mozalloc \
-        ${TOPSRCDIR}/memory/mozjemalloc \
         ${tgtpath}/memory
 
     # remove *.pyc and *.pyo files if any
     find ${tgtpath} -type f -name "*.pyc" -o -name "*.pyo" |xargs rm -f
 
     # Remove non-JS Cargo.toml files (for example, the invalid Cargo.toml files
     # used for some testing).
     find ${tgtpath} -type f -name Cargo.toml | grep -v js | xargs rm -f
rename from memory/mozjemalloc/Makefile.in
rename to memory/build/Makefile.in
--- a/memory/build/moz.build
+++ b/memory/build/moz.build
@@ -1,30 +1,32 @@
 # -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
 # vim: set filetype=python:
 # This Source Code Form is subject to the terms of the Mozilla Public
 # 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/.
 
 EXPORTS += [
+    'mozjemalloc_types.h',
     'mozmemory.h',
     'mozmemory_wrap.h',
 ]
 
 LIBRARY_DEFINES['MOZ_HAS_MOZGLUE'] = True
 DEFINES['MOZ_MEMORY_IMPL'] = True
 
 if CONFIG['MOZ_REPLACE_MALLOC']:
     EXPORTS += [
         'malloc_decls.h',
         'replace_malloc.h',
         'replace_malloc_bridge.h',
     ]
 
 SOURCES += [
+    'mozjemalloc.cpp',
     'mozmemory_wrap.c',
 ]
 
 if CONFIG['OS_TARGET'] == 'Darwin' and (CONFIG['MOZ_REPLACE_MALLOC'] or
         CONFIG['MOZ_MEMORY']):
     SOURCES += [
         'zone.c',
     ]
@@ -37,8 +39,18 @@ if CONFIG['MOZ_GLUE_IN_PROGRAM']:
 if CONFIG['OS_TARGET'] == 'Android' and CONFIG['CC_TYPE'] == 'clang':
     CFLAGS += [
         '-Wno-tautological-pointer-compare',
     ]
 
 # Keep jemalloc separated when mozglue is statically linked
 if CONFIG['MOZ_MEMORY'] and CONFIG['OS_TARGET'] in ('WINNT', 'Darwin', 'Android'):
     FINAL_LIBRARY = 'mozglue'
+
+if CONFIG['GNU_CXX']:
+    # too many warnings from functions generated through rb_wrab from rb.h.
+    CXXFLAGS += ['-Wno-unused-function',
+                 '-Wno-error=uninitialized']
+
+if CONFIG['_MSC_VER']:
+    CXXFLAGS += ['-wd4273'] # inconsistent dll linkage (bug 558163)
+
+DisableStlWrapping()
rename from memory/mozjemalloc/mozjemalloc.cpp
rename to memory/build/mozjemalloc.cpp
rename from memory/mozjemalloc/mozjemalloc.h
rename to memory/build/mozjemalloc.h
rename from memory/mozjemalloc/mozjemalloc_types.h
rename to memory/build/mozjemalloc_types.h
rename from memory/mozjemalloc/rb.h
rename to memory/build/rb.h
--- a/memory/moz.build
+++ b/memory/moz.build
@@ -15,13 +15,12 @@ DIRS += [
 if not CONFIG['JS_STANDALONE']:
     DIRS += ['volatile']
 
 if CONFIG['MOZ_MEMORY']:
     # NB: gtest dir is included in toolkit/toolkit.build due to its dependency
     # on libxul.
     DIRS += [
         'build',
-        'mozjemalloc',
     ]
 
     if CONFIG['MOZ_REPLACE_MALLOC']:
         DIRS += ['replace']
deleted file mode 100644
--- a/memory/mozjemalloc/moz.build
+++ /dev/null
@@ -1,30 +0,0 @@
-# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
-# vim: set filetype=python:
-# This Source Code Form is subject to the terms of the Mozilla Public
-# 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/.
-
-EXPORTS += [
-    'mozjemalloc_types.h',
-]
-
-SOURCES += [
-    'mozjemalloc.cpp',
-]
-FINAL_LIBRARY = 'memory'
-
-DEFINES['MOZ_MEMORY_IMPL'] = True
-
-LOCAL_INCLUDES += [
-    '/memory/build',
-]
-
-if CONFIG['GNU_CXX']:
-    # too many warnings from functions generated through rb_wrab from rb.h.
-    CXXFLAGS += ['-Wno-unused-function',
-                 '-Wno-error=uninitialized']
-
-if CONFIG['_MSC_VER']:
-    CXXFLAGS += ['-wd4273'] # inconsistent dll linkage (bug 558163)
-
-DisableStlWrapping()
--- a/toolkit/content/license.html
+++ b/toolkit/content/license.html
@@ -3886,17 +3886,17 @@ OUT OF OR IN CONNECTION WITH THE SOFTWAR
 THE SOFTWARE.
 </pre>
 
     <hr>
 
     <h1><a id="jemalloc"></a>jemalloc License</h1>
 
     <p>This license applies to portions of the files in the directory
-    <code>memory/mozjemalloc/</code>.
+    <code>memory/build/</code>.
     </p>
 
 <pre>
 Copyright (C) 2006-2008 Jason Evans &lt;jasone@canonware.com&gt;.
 All rights reserved.
 Copyright (C) 2007-2017 Mozilla Foundation.
 
 Redistribution and use in source and binary forms, with or without