Commit Graph

440 Commits

Author SHA1 Message Date
Chris Peterson
dcce483a80 Bug 1019381 - Cherrypick clang and gcc warning fixes from upstream jemalloc. r=glandium 2014-05-28 19:02:11 -07:00
Mike Hommey
e5d63cd0b2 Bug 965870 - Check for __builtin_ffsl before ffsl. r=mshal
Cherry-picked from 1a3eafd1b0
2014-06-06 08:17:02 +09:00
Mike Hommey
90ff451c5a Bug 965870 - Try to use __builtin_ffsl if ffsl is unavailable. r=mshal
Cherry-picked from 9c3a10fdf6
2014-06-06 08:15:58 +09:00
Mike Hommey
9e320ff764 Bug 945582 - Don't use jemalloc3 C99 headers with MSVC versions that have (some) C99 support. r=mshal
--HG--
rename : memory/jemalloc/src/include/msvc_compat/inttypes.h => memory/jemalloc/src/include/msvc_compat/C99/inttypes.h
rename : memory/jemalloc/src/include/msvc_compat/stdbool.h => memory/jemalloc/src/include/msvc_compat/C99/stdbool.h
rename : memory/jemalloc/src/include/msvc_compat/stdint.h => memory/jemalloc/src/include/msvc_compat/C99/stdint.h
2014-05-31 09:54:23 +09:00
Nicholas Nethercote
e754ebe47b Bug 1017911 - DMD: don't use alloca(), because it's a pain to get working on multiple platforms. r=mccr8.
DONTBUILD because DMD is NPOTB.

--HG--
extra : rebase_source : 0b400b76583032f30a9a4b8c935b03c015fc9772
2014-05-29 17:04:23 -07:00
Jan Beich
c0e1b525ed Bug 1015602 - Populate chunksize/bin_unused for MOZ_JEMALLOC3 as they're now used after bug 1006769. r=erahm 2014-05-24 06:41:00 -04:00
Ehsan Akhgari
014df8031e Bug 1015012 - Make the VolatileBuffer constructors explicit; r=froydnj 2014-05-25 21:25:33 -04:00
Eric Rahm
56e0190c90 Bug 1006769 - Part 2: Backport jemalloc3 run_size_calc logic. r=glandium 2014-05-21 17:34:07 -07:00
Eric Rahm
cc0ba9c941 Bug 1006769 - Part 1: Improve heap-overhead memory reporting. r=njn 2014-05-21 17:34:06 -07:00
Nicholas Nethercote
c360e10994 Bug 1014249 - Beef up the "is DMD enabled?" and "is DMD running?" checks. r=mccr8.
--HG--
extra : rebase_source : 868ce1a1e470e45f51447f5126982aaeb51905f1
2014-05-22 19:45:14 -07:00
Nicholas Nethercote
2665a9896d Bug 1013014 (attempt 2) - Disable Trace Malloc on TBPL debug builds. r=glandium.
--HG--
extra : rebase_source : 08fa200fd205225f85b9845bf8c18ac38fe26e0d
2014-05-19 18:16:42 -07:00
Mike Hommey
85c6417ab2 Bug 1014308 - Update jemalloc3 to upstream 3.6.0. r=njn,r=mshal 2014-05-23 07:26:40 +09:00
Mike Hommey
df321a040e Bug 1014300 - Ship replace_jemalloc library (jemalloc3) when replace-malloc is enabled. r=mshal 2014-05-23 07:24:22 +09:00
Nicholas Nethercote
7e96ed6dba Bug 1013011 - DMD: Remove stack frame records. r=erahm.
DONTBUILD because DMD is NPOTB.
2014-05-19 19:57:50 -07:00
Eric Rahm
571ebf0713 Bug 1000621 - Check if DMD is enabled before dumping. r=njn. DONTBUILD 2014-04-24 12:43:11 -07:00
Nathan Froyd
3262d22d1e Bug 993522 - fix comment in DMD.h; r=njn 2014-04-08 13:07:46 -04:00
Michael Wu
c62e4a0856 Bug 985017 - [1/2] Support null VolatileBufferPtrs, r=glandium 2014-04-02 21:32:54 -04:00
Mike Hommey
136f02ac45 Bug 984447 - Properly handle forks in mozjemalloc after bug 694896. r=smichaud 2014-03-29 16:53:49 +09:00
Thomas Zimmermann
2ac234407a Bug 979887: Fix GCC warning about undeclared function |vsnprintf|, r=glandium 2014-03-06 11:20:00 +01:00
Thomas Zimmermann
1a335a7c9c Bug 979887: Fix GCC warnings about inline variable declarations, r=glandium
Some code is compiled in C90 mode, where inline declarations of
variables are not allowed.
2014-03-06 11:19:57 +01:00
Ehsan Akhgari
444a26ed8e Bug 976896 - Port STL_FLAGS to moz.build; r=mshal 2014-03-04 19:39:06 -05:00
Masatoshi Kimura
fa7493eea4 Bug 978442 - Use WindowsVersion.h from VolatileBuffer. r=mwu 2014-03-02 10:29:13 +09:00
Frank Wein
d4838a5c54 Bug 977667 - VolatileBufferFallback.cpp:16:10: error: ‘nullptr’ was not declared in this scope, r=glandium 2014-02-28 12:32:14 +01:00
Ehsan Akhgari
83afc1afae Bug 935778 - Part 0.4: Spray even more MOZ_DECLARE_REFCOUNTED_TYPENAME across the tree 2014-02-21 09:11:33 -05:00
Jacek Caban
3ad1b4cc71 Bug 748598 - Fixed cross compilation on case sensitive OSes. 2014-02-20 17:22:42 +01:00
Michael Wu
40e9b9b3b9 Bug 972693 - Explicitly ignore return values from moz_posix_memalign, r=glandium 2014-02-14 02:15:44 -05:00
Ehsan Akhgari
da11692a23 Bug 973403 - Move the LOCAL_INCLUDES in memory to moz.build; r=glandium 2014-02-18 01:05:51 -05:00
Ms2ger
aa9d7b52b4 Bug 968856 - Move unconditional LOCAL_INCLUDES into moz.build; r=mshal 2014-02-15 21:24:59 +01:00
Michael Wu
9315582b3a Bug 748598 - Implement VolatileBuffer for OSX, Ashmem, and Windows, r=njn,glandium 2014-01-22 08:23:27 -05:00
David Major
0cbf1c6af0 Bug 860254 - Part 4: Enable poisoning. r=glandium 2014-02-13 20:11:15 -05:00
David Major
e871b5f5e6 Bug 860254 - Part 2: Split junk settings into opt_junk (allocate) versus opt_poison (deallocate). r=glandium 2014-01-14 11:56:18 -08:00
David Major
85c4adcd8b Bug 860254 - Part 1: #define MALLOC_FILL but keep the options const-false. r=glandium 2014-02-13 20:10:35 -05:00
Ehsan Akhgari
82ebdc883f Bug 969757 - Remove the dead code in our tree which pretends to support OS/2; r=roc,mcmanus,gps,jorendorf,bsmedberg sr=bsmedberg 2014-02-10 17:57:01 -05:00
Eric Rahm
fd7a877f62 Bug 968956 - DMD: Acquire state lock before clearing reports. r=njn.
DONTBUILD because DMD is NPOTB.

--HG--
extra : rebase_source : c3e5b2f27d4983c5802f1a38c8accc31a2b07fa2
2014-02-07 15:23:50 -08:00
Marcin Juszkiewicz
ade3a20e0c Bug 963028 - AArch64 support for jemalloc. r=froydnj 2014-01-23 16:34:31 -05:00
Shelly Lin
f6f99623dd Bug 801571 - Override vasprintf and asprint for Android platform to avoid the mismatch of malloc()/free(). r=glandium 2014-01-17 16:54:06 +08:00
Ryan VanderMeulen
60acc925d2 Backed out changeset 4230d328b65f (bug 801571) for memory leaks. 2014-01-17 14:25:28 -05:00
Shelly Lin
47b57d305a Bug 801571 - Override vasprintf and asprint for Android platform to avoid the mismatch of malloc()/free(). r=glandium
DONTBUILD
2014-01-17 16:54:06 +08:00
Ryan VanderMeulen
7c2f1de96a Backed out changeset 0496d73bf88e for landing with the wrong bug # in the commit message. 2014-01-17 11:13:30 -05:00
Shelly Lin
540bc61288 Bug 801517 - Override vasprintf and asprint for Android platform to avoid the mismatch of malloc()/free(). r=glandium 2014-01-17 16:54:06 +08:00
Kai-Zhen Li
87b926b16a Bug 957450 - fix compile error from jemalloc in gonk-kk. r=gal 2014-01-10 14:14:53 +08:00
Marco Chen
c601f4d618 Backout 977d6be3df40 Bug 957450 - The added "or condition" didn't prevent gonk-kk version fall into non-const definition. 2014-01-15 15:55:12 +08:00
Jon Coppeard
e177b13fa0 Bug 956501 - Update mozjemalloc chunk_alloc_mmap functions to latest upstream version r=glandium 2014-01-14 10:06:25 +00:00
Kai-Zhen Li
2ef0f4279e Bug 957450 - fix compile error in gonk-kk. r=iacobcatalin 2014-01-10 14:14:53 +08:00
Nicholas Nethercote
c3b3163a0c Bug 950545 (part 2) - Fix assertion failures and output mismatches in the DMD test. r=iacobcatalin.
DONTBUILD because DMD is NPOTB

--HG--
extra : rebase_source : 48388b467bcbce8347792c8e7f0cb45b1fc177aa
2013-12-18 13:58:08 -08:00
Nicholas Nethercote
8813ddf3ef Bug 950545 (part 1) - Fix the dump numbering in the DMD test. r=iacobcatalin.
--HG--
extra : rebase_source : 2b04382850c19aff46fce02d02ce1c235edde473
2013-12-18 13:55:47 -08:00
Nicholas Nethercote
2f4ba4debf Bug 948621 (part 2) - Abort DMD-enabled Windows builds unless --enable-profiling is specified. r=ehsan.
--HG--
extra : rebase_source : 7398d8d7f13792912f27948f9681ff608a0e90c6
2013-12-15 13:50:39 -08:00
Nicholas Nethercote
7424fb1500 Bug 948621 (part 1) - DMD: Handle arbitrary PC values in stack frames. r=iacobcatalin.
DONTBUILD because NPOTB

--HG--
extra : rebase_source : 63a30251498dc5e5df2952a468f46ada8598e03e
2013-12-15 13:47:11 -08:00
Mike Hommey
255ad3e210 Bug 945042 - Move NO_PROFILE_GUIDED_OPTIMIZE to moz.build. r=gps,r=njn 2013-12-09 13:39:26 +09:00
Birunthan Mohanathas
bd0f161288 Bug 713082 - Part 1: Remove unnecessary Util.h includes. r=Waldo 2013-12-08 21:52:33 -05:00
Mike Shal
009ce11f2a Bug 875013 - Remove VPATH; r=glandium 2013-11-21 14:57:06 -05:00
Markus Stange
5302a0f06c Bug 945131 - Fix DMD build by using const char*. r=njn
DONTBUILD because NPOTB
2013-12-02 23:13:20 +01:00
Catalin Iacob
1b51a108f3 Bug 819839 - Part 2 - Print file name and line number if available in DMD report. r=njn 2013-11-29 16:09:42 +01:00
Mike Hommey
fdd3247a81 Bug 874266 - Move all DEFINES that can be moved to moz.build. r=mshal 2013-11-27 22:55:07 +09:00
Mike Hommey
2f727b6d62 Backout changeset 3fd4b546eed4 (bug 874266) and changeset a35d2e3a872f (bug 942043) for ASAN build bustage and Windows test bustage
--HG--
extra : amend_source : f20d09aeff1c8b5cbd0f1d24c7ce04e86f3aed1d
2013-11-28 14:24:05 +09:00
Mike Hommey
b038245b8d Bug 874266 - Move all DEFINES that can be moved to moz.build. r=mshal 2013-11-28 13:08:16 +09:00
Catalin Iacob
31159dc048 Bug 940218 - Build memory/ in unified mode; r=ehsan 2013-11-25 12:09:59 +01:00
Ehsan Akhgari
2ec4903801 Backed out changeset c3d41ab0a2df (bug 940218) for causing bug 941616
--HG--
extra : rebase_source : c0d9b2840ddb6a6b88b86cfc3e3a6810ac9e37e2
2013-11-21 14:28:52 -05:00
Nathan Froyd
3734e2e69f Bug 941616 - fix jemalloc build for --enable-replace-malloc; r=ehsan 2013-11-21 09:46:32 -05:00
Chris Peterson
6c5ab32845 Bug 940218 - Build memory/jemalloc and friends in unified mode. r=glandium 2013-11-17 01:16:36 -08:00
Mike Hommey
636b672657 Bug 914245 - Move FORCE_SHARED_LIB to moz.build. r=mshal 2013-11-19 11:47:45 +09:00
Mike Hommey
f0d1cd1e10 Bug 939044 - Remove most definitions of MODULE. r=mshal 2013-11-19 11:47:39 +09:00
Mike Hommey
9c5c5d8f00 Bug 939039 - Remove now useless FORCE_STATIC_LIB definitions. r=gps 2013-11-19 11:47:28 +09:00
Mike Hommey
f81885e53b Bug 935881 - Use FINAL_LIBRARY for all (fake) libraries that end up linked in a single other library. r=gps 2013-11-19 11:47:14 +09:00
Birunthan Mohanathas
192d1ba4c1 Bug 784739 - Switch from NULL to nullptr in miscellaneous directories; r=ehsan 2013-11-11 14:17:14 -05:00
Daniel Holbert
17bbc689ce Bug 926275: Remove mozalloc_macro_wrappers.h and mozalloc_undef_macro_wrappers.h. r=bsmedberg 2013-10-31 19:39:03 -07:00
David Major
113eaa4daf Bug 931196 - Remove MOZ_TEMP_INVESTIGATION poisoning code. r=glandium 2013-10-31 11:52:08 -04:00
Ted Mielczarek
46db2c02bd Bug 930674 - convert VISIBILITY_FLAGS in Makefile.in to NO_VISIBILITY_FLAGS in moz.build. r=mshal 2013-10-24 15:06:19 -04:00
Cykesiopka
be7f216715 Bug 914270 - Part 2: Manual moves. r=joey 2013-10-24 18:52:00 +01:00
Cykesiopka
e0bcd6aebc Bug 914270 - Part 1: Simple/Automated moves. r=joey 2013-10-24 18:51:00 +01:00
Mike Hommey
f1c0c07862 Bug 929905 - Consolidate sources in moz.build. r=gps 2013-10-25 08:23:05 +09:00
Mike Hommey
5072f65f8c Bug 913268 - Make CPP_SOURCES a StrictOrderingOnAppendList. r=mshal 2013-10-24 08:00:23 +09:00
Masatoshi Kimura
f54ab71d02 Bug 928210 - Get rid of MOZ_INLINE 2013-10-22 06:34:24 +09:00
Nathan Froyd
741ae62ad8 Bug 925169 - part 1 - don't use MOZ_MEMORY_SIZEOF_PTR_2POW in jemalloc.c; r=glandium 2013-10-09 19:04:43 -04:00
Ms2ger
563e32eb62 Bug 923489 - Part c: qualify paths in memory/replace/dmd/; r=gps 2013-10-05 13:28:25 +02:00
Ms2ger
cfd2b19df5 Bug 923489 - Part b: qualify paths in memory/replace/jemalloc/; r=gps 2013-10-05 12:19:08 +02:00
Ms2ger
7a421fd90e Bug 923489 - Part a: qualify paths in memory/jemalloc/; r=gps 2013-10-05 12:18:36 +02:00
Mike Hommey
05b3f24e0e Bug 912293 - Remove now redundant boilerplate from Makefile.in. r=gps 2013-09-05 09:01:46 +09:00
Brian O'Keefe
0ee041b9fd Bug 875934 - Move LIBRARY_NAME to moz.build, batch 3; r=mshal 2013-08-15 09:02:09 -04:00
Douglas Crosher
023f3a586e Bug 908971 - jemalloc: fix uninitialized 'mapped' variable. r=jlebar 2013-08-24 13:35:08 +10:00
Justin Lebar
e8eb0d970a Bug 903420 - Two fixes to jemalloc's memory reporters. r=glandium
1) We were counting "dirty" pages in "waste", when we shouldn't have
   been.  This was causing the assertion at the end of jemalloc_stats()
   which checks that mapped memory is greater than committed memory to
   fail.

2) jemalloc_stats used stats_chunks.curchunks to measure the number of
   mapped pages.  This was problematic for two reasons.

   a) stats_chunks.curchunks was not locked when it was modified in
      chunk_{de}alloc(), so its value could be garbage.

   b) Even if it had been locked properly, it was possible for an
      allocation to occur during a call to jemalloc_stats which would
      cause the measured amount of allocated memory to exceed the
      measured amount of mapped memory, tripping the assertion we
      tripped in (1).

   We fixed these issues by deleting stats_chunks entirely, and by
   introducing huge_mapped, which measures the amount of memory mapped
   by huge allocations (and is properly protected by huge_mtx).

   We now measure the amount of mapped memory by adding huge_mapped and
   each arena's mapped memory, and we do this in such a way that even if
   an allocation occurs during our call to jemalloc_stats, we'll still
   get a consistent result (where mapped >= committed).
2013-08-15 11:15:04 -07:00
Mike Hommey
29dbd867f2 Bug 901211 - Don't use static page size on ia64, sparc and mips. r=jlebar 2013-08-05 09:10:35 +09:00
Ms2ger
21409e5d2c Merge m-c to inbound. 2013-08-02 11:07:57 +02:00
Ms2ger
fe9c33f5f4 Bug 897921 - Remove some dead assignments in makefiles; r=mshal 2013-08-02 09:03:55 +02:00
Justin Lebar
ada67088ce Bug 899880 - Fix jemalloc3 so it works after bug 898558, which changed jemalloc's stats struct. r=glandium 2013-08-01 16:37:54 -07:00
Ehsan Akhgari
085494b95d Bug 895322 - Part 1: Replace the usages of MOZ_STATIC_ASSERT with C++11 static_assert; r=Waldo
This patch was mostly generated by running the following scripts on the codebase, with some
manual changes made afterwards:

# static_assert.sh
#!/bin/bash
# Command to convert an NSPR integer type to the equivalent standard integer type

function convert() {
echo "Converting $1 to $2..."
find . ! -wholename "*nsprpub*" \
       ! -wholename "*security/nss*" \
       ! -wholename "*/.hg*" \
       ! -wholename "obj-ff-dbg*" \
       ! -name nsXPCOMCID.h \
       ! -name prtypes.h \
         -type f \
      \( -iname "*.cpp" \
         -o -iname "*.h" \
         -o -iname "*.cc" \
         -o -iname "*.mm" \) | \
    xargs -n 1 `dirname $0`/assert_replacer.py #sed -i -e "s/\b$1\b/$2/g"
}

convert MOZ_STATIC_ASSERT static_assert
hg rev --no-backup mfbt/Assertions.h \
                   media/webrtc/signaling/src/sipcc/core/includes/ccapi.h \
                   modules/libmar/src/mar_private.h \
                   modules/libmar/src/mar.h


# assert_replacer.py
#!/usr/bin/python

import sys
import re

pattern = re.compile(r"\bMOZ_STATIC_ASSERT\b")

def replaceInPlace(fname):
  print fname
  f = open(fname, "rw+")
  lines = f.readlines()
  for i in range(0, len(lines)):
    while True:
      index = re.search(pattern, lines[i])
      if index != None:
        index = index.start()
        lines[i] = lines[i][0:index] + "static_assert" + lines[i][index+len("MOZ_STATIC_ASSERT"):]
        for j in range(i + 1, len(lines)):
          if lines[j].find("                 ", index) == index:
            lines[j] = lines[j][0:index] + lines[j][index+4:]
          else:
            break
      else:
        break
  f.seek(0, 0)
  f.truncate()
  f.write("".join(lines))
  f.close()

argc = len(sys.argv)
for i in range(1, argc):
  replaceInPlace(sys.argv[i])

--HG--
extra : rebase_source : 4b4a4047d82f2c205b9fad8d56dfc3f1afc0b045
2013-07-18 13:59:53 -04:00
Justin Lebar
820d692af0 Bug 898558 - Rework jemalloc_stats so it exposes how much memory is used for bookkeeping. r=glandium
This patch also gets rid of the redundant "committed" entry, so now
there's no confusion as to which entries overlap.

--HG--
extra : rebase_source : 429f3d44011f02dda43aa10b077c917c4d02fe50
2013-07-29 09:10:53 -07:00
Daniel Holbert
aac499cf28 Bug 581478: undef strdup before (re)defining it in mozalloc_macro_wrappers.h. r=glandium 2013-07-25 18:14:41 -07:00
Mike Shal
fb38e981d0 Bug 889787 - Define XP_LINUX globally; r=ted 2013-07-16 17:10:10 -04:00
Mike Hommey
e9ee5bb8ee Bug 892904 - Remove useless includes of config.mk. r=gps 2013-07-15 18:48:40 +09:00
Gregory Szorc
0a41c9c2f9 Bug 891632 - Port NO_DIST_INSTALL to moz.build; r=joey
Many of the moved variables are likely not needed. moz.build should one
day validate the sandbox's output and error if "useless" variables are
present.

--HG--
extra : rebase_source : 3abdea056c18d00ede8c15b37db60532eca58630
2013-07-10 12:08:21 -07:00
Catalin Iacob
83b78343dc Bug 798914 (part 5) - Use newly introduced mozilla::MallocSizeOf instead of nsMallocSizeOfFun. r=njn.
--HG--
extra : rebase_source : fc472490dd978d165f02f77ed37f07aed6e5bb61
2013-06-23 14:03:39 +02:00
Brian O'Keefe
20b45036df Bug 875934 - Move LIBRARY_NAME to moz.build (batch #2); r=mshal
--HG--
extra : rebase_source : 555b28e5c3412ffc210c60b6fe2fee6f053fd587
2013-06-18 08:13:42 -04:00
Brian O'Keefe
ed17339221 Bug 875934 - Move LIBRARY_NAME to moz.build (batch #1); r=mshal
--HG--
extra : rebase_source : 385d3fd65475ffc18ee44ae088753649470e214b
2013-06-17 15:21:01 -04:00
Joey Armstrong
32009a30fd bug 870406: move CSRCS to mozbuild (config batch #2) r=mshal 2013-06-04 11:08:44 -04:00
Mike Shal
6f32ddf61c Bug 864774 - Part 2: Move CPPSRCS to moz.build as CPP_SOURCES; r=joey CLOSED TREE
From 9e0ba7f425143f545eb6c4b26a9a96b5ade4d8e9 Mon Sep 17 00:00:00 2001
2013-04-23 17:54:15 -04:00
David Zbarsky
7e26888daa Fix b2g build, no bug 2013-05-16 18:07:12 -07:00
Bill McCloskey
6b96448f68 Bug 863116 - MOZ_ALWAYS_INLINE should not inline in debug builds (r=Waldo) 2013-04-19 10:55:34 -07:00
Mike Shal
24b4056720 Bug 846634 - Part 2: Move EXPORTS to moz.build; r=joey 2013-04-16 15:24:43 -04:00
Nicholas Nethercote
41efbb243a Bug 848560 (part 1) - dmd::ClearReports() needs to check if DMD is running before doing anything to avoid crashing. r=jlebar.
--HG--
extra : rebase_source : bdd7a6d1654dfbf562bc534311869248eb3c8a4a
2013-03-25 21:03:47 -07:00