Граф коммитов

787 Коммитов

Автор SHA1 Сообщение Дата
Mike Hommey fade48cbe6 Bug 1365206 - Remove Sun Studio compiler optimization flags for mozjemalloc. r=gps
We don't support that compiler anymore.
2017-05-19 08:29:05 +09:00
Mike Hommey fbbe2d361d Bug 1365460 - Remove function prototypes but keep necessary forward declarations. r=njn
--HG--
extra : rebase_source : 670aecc65cf709f2312a29c80e3c3171ccb2c8c2
2017-05-18 16:27:06 +09:00
Mike Hommey 1dfc7df618 Bug 1365460 - Make umax2s support only base 10. r=njn
Other bases are never used.

--HG--
extra : rebase_source : 6c8edcbde86480995b2d96ac513724e3212457cf
2017-05-18 16:22:10 +09:00
Mike Hommey eaa9da1203 Bug 1365460 - Avoid unused variables. r=njn
--HG--
extra : rebase_source : 18cd68afc595aca1177e453f6c60a65de1d0dece
2017-05-18 12:24:57 +09:00
Mike Hommey be0c2ffbc5 Bug 1365460 - Remove warning exceptions for MSVC and work around them. r=njn
--HG--
extra : rebase_source : 182c1e5583950f52a5eadc9fcf5d0b72ba4c56a9
2017-05-18 12:13:34 +09:00
Mike Hommey 61860e7f63 Bug 1365460 - Don't define integer types that MSVC >= 2015 know about. r=njn
--HG--
extra : rebase_source : 6a13970a477fda647eaed1dc381ecb993297922f
2017-05-18 12:09:38 +09:00
Mike Hommey d3f17931b7 Bug 1365460 - Remove JEMALLOC_USES_MAP_ALIGN. r=njn
It's a Solaris-only optimization that was used as a workaround for some
infinite loop in pages_map (bug 457189). In the meanwhile, the way
pages_map works has changed in such a way the infinite loop can't happen
anymore.

Specifically, the original problem was that pages_map would try to
allocate something larger than a chunk, then deallocate it, and
reallocate at a hinted aligned address near the address of the now
deallocated mapping, hopefully getting an aligned chunk. But Solaris
would ignore the hint and the chunk would never be aligned, causing the
infinite loop.

What the code does now it over-allocate, find an aligned chunk in there,
and deallocate what ends up not being needed. Which leaves no room for
the original infinite loop.

We thus remove the workaround and put Solaris in par with other Unix
platforms.

--HG--
extra : rebase_source : 9ce4509d9c5ac6123cedabf87c5738672af35d1b
2017-05-18 11:30:52 +09:00
Mike Hommey 3dce495fff Bug 1365460 - Use MOZ_DIAGNOSTIC_ASSERT where mozjemalloc uses RELEASE_ASSERT. r=njn
In Gecko code, MOZ_RELEASE_ASSERT means assertions that happen on all
types of builds.

In mozjemalloc, RELEASE_ASSERT means assertions that happen when
MOZ_JEMALLOC_HARD_ASSERTS is set, otherwise normal assertions. Which is
confusing. On the other hand, it's very similar to
MOZ_DIAGNOSTIC_ASSERT, and we may just want to use that instead.

Moreover, with release promotion, the check setting
MOZ_JEMALLOC_HARD_ASSERTS means releases (promoted from beta) would end
up with those asserts while they're not meant to, so
MOZ_DIAGNOSTIC_ASSERT is actually closer to the intent. It however means
we'd lose the beta population running those assertions.

--HG--
extra : rebase_source : 606ab47af8d9ee793b13b806acadb9781c99a078
2017-05-18 10:57:43 +09:00
Mike Hommey 175a4c0a2a Bug 1365460 - Replace assert with MOZ_ASSERT. r=njn
--HG--
extra : rebase_source : fab2172c763518c8f08efd99b0f9d9c3fdde42af
2017-05-18 10:52:00 +09:00
Mike Hommey 7c28b3d25e Bug 1365460 - Expand the __crtInitCritSecAndSpinCount macro and remove it. r=njn
--HG--
extra : rebase_source : 1149b2446447a423704f147dad8e404792e83938
2017-05-18 10:39:08 +09:00
Mike Hommey 77cecfcb4b Bug 1365460 - Replace __DECONST with const_cast. r=njn
--HG--
extra : rebase_source : 5222652581d27e68a6af71ec8b9e2c30446c18d2
2017-05-18 10:37:08 +09:00
Mike Hommey fdda7f976a Bug 1365460 - Remove JEMALLOC_MUNMAP/config_munmap, they are always true. r=njn
--HG--
extra : rebase_source : 420913999fc1c49ec8b6134f9768ced4355b4a2d
2017-05-18 10:34:38 +09:00
Mike Hommey 139dee33bb Bug 1365460 - Remove JEMALLOC_RECYCLE/config_recycle, they are always true. r=njn
--HG--
extra : rebase_source : de942f6ffaec1d17239a76606590f5cc2477a405
2017-05-18 10:32:30 +09:00
Mike Hommey c6aa8aa7c7 Bug 1365460 - Remove runtime support for SysV malloc semantics. r=njn
Support for them was only enabled on debug builds, and required an
opt-in through e.g. MALLOC_OPTIONS to actually enable at runtime.

--HG--
extra : rebase_source : 60c27585c2901a73eb790cec124b880c93da6ef7
2017-05-18 10:28:28 +09:00
Mike Hommey 92ba43731c Bug 1365460 - Replace MOZ_MEMORY_DEBUG, MALLOC_DEBUG and !MALLOC_PRODUCTION with MOZ_DEBUG. r=njn
--HG--
extra : rebase_source : eeae81907bb80f78d0ab83343cc514f483d5ddc0
2017-05-18 10:22:20 +09:00
Mike Hommey 72d4bc9cc3 Bug 1365460 - Define _malloc_message as a function instead of a pointer to a function. r=njn
--HG--
extra : rebase_source : ea3088ad12ae2e0879beceac48f01ecdeb5c8f3a
2017-05-18 10:18:36 +09:00
Mike Hommey d1b9ff45e8 Bug 1365460 - Remove support for /etc/malloc.conf. r=njn
While it makes sense for a global system allocator, it's not really
interesting for Firefox to respect that. Plus, newer versions of
jemalloc, which are more likely to be used as a global system allocator
use a different format for the options passed through that file.

--HG--
extra : rebase_source : 0f2283cf5660bc437bd097bf48c2b5989fa08011
2017-05-18 10:12:18 +09:00
Mike Hommey f3762790b7 Bug 1365460 - Remove the inline extra malloc options. r=njn
Those options, complementing the MALLOC_OPTIONS environment variable,
were always empty since the removal of b2g.

--HG--
extra : rebase_source : 0e34cfce0b537ebb8ed3902bd46180dc205cb0e4
2017-05-18 10:06:29 +09:00
Mike Hommey 937023c28a Bug 1365460 - Remove the possibility to disable free() poisoning at runtime. r=njn
--HG--
extra : rebase_source : 1d98488d73bc8015ad1fd057ae0655b0f847d679
2017-05-18 10:03:43 +09:00
Mike Hommey 5858dd93d2 Bug 1365460 - Replace literal 0xe4/0xe5 junk/poison values with constants. r=njn
--HG--
extra : rebase_source : 085fd31f00e4afef8c990d54f77c0301b2502f3d
2017-05-18 10:02:36 +09:00
Mike Hommey 91f81f5e20 Bug 1365460 - Remove unused qr.h and ql.h headers. r=njn
--HG--
extra : rebase_source : b585b93c9523996400e50e29faa346618601cf28
2017-05-17 11:25:45 +09:00
Mike Hommey 4933268c6e Bug 1365460 - Remove unused macros from rb.h. r=njn
--HG--
extra : rebase_source : b3730f71ac83e106233ed42195a6f44fd32380a4
2017-05-17 11:23:10 +09:00
Iris Hsiao 0bbdca7c50 Merge mozilla-central to autoland
--HG--
rename : memory/mozjemalloc/jemalloc.c => memory/mozjemalloc/mozjemalloc.cpp
2017-05-18 14:15:19 +08:00
Jim Chen 9579d51797 Bug 1360321 - 3. Don't use mmap2 on Android AArch64 in mozjemalloc; r=glandium
Android NDK defines SYS_mmap2 but it expands to a nonexistent symbol.
mmap2 may not be supported in any case in some AArch64 kernels, so we
should just use mmap.

MozReview-Commit-ID: 5Vjuja5fLIL
2017-05-17 13:06:21 -04:00
Carsten "Tomcat" Book f55349994f Backed out changeset 484c5137e19f (bug 1365194) to clean up spidermonkey 2017-05-17 11:44:17 +02:00
Carsten "Tomcat" Book 766c2581c8 Backed out changeset d8de424663b7 (bug 1365194) 2017-05-17 11:43:28 +02:00
Carsten "Tomcat" Book 9c3f61e278 Backed out changeset b56224bf370d (bug 1365194) 2017-05-17 11:43:26 +02:00
Carsten "Tomcat" Book d0e69c4bdb Backed out changeset 4b9c2fb40653 (bug 1365194) 2017-05-17 11:43:24 +02:00
Carsten "Tomcat" Book c994a231f0 Backed out changeset 9711f5bbda3b (bug 1365194)
--HG--
rename : memory/mozjemalloc/mozjemalloc.cpp => memory/mozjemalloc/jemalloc.c
2017-05-17 11:43:22 +02:00
Carsten "Tomcat" Book 921529ef63 Backed out changeset 4553b67c794f (bug 1365473) for breaking spidermonkey with illegal token on right side of..
--HG--
rename : memory/mozjemalloc/mozjemalloc_types.h => memory/mozjemalloc/jemalloc_types.h
2017-05-17 11:31:32 +02:00
Mike Hommey e7764f68e0 Bug 1365473 - Rename jemalloc_types.h to mozjemalloc_types.h. r=njn
--HG--
rename : memory/mozjemalloc/jemalloc_types.h => memory/mozjemalloc/mozjemalloc_types.h
extra : rebase_source : 542d0f115f54099517f3eb9a2e0f93f8987f4f63
2017-05-12 21:52:25 +09:00
Mike Hommey b302af7bc0 Bug 1365473 - Rename jemalloc_types.h to mozjemalloc_types.h. r=njn
--HG--
rename : memory/mozjemalloc/jemalloc_types.h => memory/mozjemalloc/mozjemalloc_types.h
extra : rebase_source : 542d0f115f54099517f3eb9a2e0f93f8987f4f63
2017-05-12 21:52:25 +09:00
Mike Hommey 67a2475101 Bug 1365194 - Compile mozjemalloc as C++. r=njn
The source file is renamed too, because the build system doesn't handle
sources changing suffix very well (at least not without a clobber).

The _GNU_SOURCE define is removed because GCC/Clang set it by default in
C++ mode.

--HG--
rename : memory/mozjemalloc/jemalloc.c => memory/mozjemalloc/mozjemalloc.cpp
extra : rebase_source : f57dbb0a66b25e70fe8c724e9250cc0d8b14f1c1
2017-05-12 21:52:25 +09:00
Mike Hommey cfcf835a7f Bug 1365194 - Remove parts of the hacks for memalign in mozjemalloc. r=njn
The hack dates back from the originally imported jemalloc code, which
couldn't assume it's built for Firefox. Now, we can assume that, which
means the code is always built with hidden visibility by default,
removing the need for the explicit hidden visibility.

Correspondingly, when building on Solaris with GCC, the default
visibility should also prevent the inlining, making the noinline
attribute redundant. And the Sun Studio path is useless since the
compiler is not supported anymore.

--HG--
extra : rebase_source : dab0ac68af56b1f9432d312665d4ff3df01fb58a
2017-05-16 20:01:55 +09:00
Mike Hommey 0400284f88 Bug 1365194 - Make `extern "C"` part of MOZ_MEMORY_API and MOZ_JEMALLOC_API. r=njn
This avoids many additions of `extern "C"` in C++ code and will avoid
having to do the same to mozjemalloc once built as C++.

--HG--
extra : rebase_source : af55696262f40a9dd16a19c29edcb9bb307d4957
2017-05-16 18:46:02 +09:00
Mike Hommey 966b5bb639 Bug 1365194 - Remove MOZ_JEMALLOC_API from _malloc_options and _malloc_message. r=njn
MOZ_JEMALLOC_API makes those symbols exported, but we're going to make
MOZ_JEMALLOC_API include `extern "C"`, which GCC warns about in this
case (can't use extern on a variable that is initialized).

While we could get around this in some way, there is not much use for
those variables being exported altogether: the only reason they are is
to allow an override when linking mozjemalloc into executables, but
doing that in Firefox requires patching the build system or passing some
specific LDFLAGS. People who really need to do that might as well apply
a patch.

They also allow run-time override through LD_PRELOAD, but one might as
well use the MALLOC_OPTIONS environment variable for _malloc_options.
As for _malloc_message, it doesn't seem very useful to override, and
probably noone ever overrode it at runtime.

Note, we may want to remove them in a followup.

--HG--
extra : rebase_source : f2dbe5dbf0bbdb369cd7c6255f624f16b8e37209
2017-05-16 18:55:24 +09:00
Mike Hommey bbdb5a1a9c Bug 1365194 - Call moz_abort directly instead of using a macro to override abort. r=njn
Using -Dabort=moz_abort actually makes the build fail in some libstdc++
headers when building as C++.

--HG--
extra : rebase_source : 77828d5c42f231372a8e75f5e3cd6af135d1d5e8
2017-05-12 21:51:16 +09:00
Mike Hommey 14503d2c39 Bug 1365194 - Compile mozjemalloc as C++. r=njn
The source file is renamed too, because the build system doesn't handle
sources changing suffix very well (at least not without a clobber).

The _GNU_SOURCE define is removed because GCC/Clang set it by default in
C++ mode.

--HG--
rename : memory/mozjemalloc/jemalloc.c => memory/mozjemalloc/mozjemalloc.cpp
extra : rebase_source : f57dbb0a66b25e70fe8c724e9250cc0d8b14f1c1
2017-05-12 21:52:25 +09:00
Mike Hommey 12cfad23f4 Bug 1365194 - Remove parts of the hacks for memalign in mozjemalloc. r=njn
The hack dates back from the originally imported jemalloc code, which
couldn't assume it's built for Firefox. Now, we can assume that, which
means the code is always built with hidden visibility by default,
removing the need for the explicit hidden visibility.

Correspondingly, when building on Solaris with GCC, the default
visibility should also prevent the inlining, making the noinline
attribute redundant. And the Sun Studio path is useless since the
compiler is not supported anymore.

--HG--
extra : rebase_source : dab0ac68af56b1f9432d312665d4ff3df01fb58a
2017-05-16 20:01:55 +09:00
Mike Hommey 2bd75405bc Bug 1365194 - Make `extern "C"` part of MOZ_MEMORY_API and MOZ_JEMALLOC_API. r=njn
This avoids many additions of `extern "C"` in C++ code and will avoid
having to do the same to mozjemalloc once built as C++.

--HG--
extra : rebase_source : af55696262f40a9dd16a19c29edcb9bb307d4957
2017-05-16 18:46:02 +09:00
Mike Hommey e05de96ab1 Bug 1365194 - Remove MOZ_JEMALLOC_API from _malloc_options and _malloc_message. r=njn
MOZ_JEMALLOC_API makes those symbols exported, but we're going to make
MOZ_JEMALLOC_API include `extern "C"`, which GCC warns about in this
case (can't use extern on a variable that is initialized).

While we could get around this in some way, there is not much use for
those variables being exported altogether: the only reason they are is
to allow an override when linking mozjemalloc into executables, but
doing that in Firefox requires patching the build system or passing some
specific LDFLAGS. People who really need to do that might as well apply
a patch.

They also allow run-time override through LD_PRELOAD, but one might as
well use the MALLOC_OPTIONS environment variable for _malloc_options.
As for _malloc_message, it doesn't seem very useful to override, and
probably noone ever overrode it at runtime.

Note, we may want to remove them in a followup.

--HG--
extra : rebase_source : f2dbe5dbf0bbdb369cd7c6255f624f16b8e37209
2017-05-16 18:55:24 +09:00
Mike Hommey 782764a6fd Bug 1365194 - Call moz_abort directly instead of using a macro to override abort. r=njn
Using -Dabort=moz_abort actually makes the build fail in some libstdc++
headers when building as C++.

--HG--
extra : rebase_source : 77828d5c42f231372a8e75f5e3cd6af135d1d5e8
2017-05-12 21:51:16 +09:00
Mike Hommey c530406a95 Bug 1365191 - Remove dead code hidden behind the never set NEEDS_PTHREAD_MMAP_UNALIGNED_TSD. r=njn
--HG--
extra : rebase_source : 79efaa1e0922c356469655f88f86b255ccc72141
2017-05-11 18:05:14 +09:00
Mike Hommey 03a5ae85e0 Bug 1365191 - Remove MALLOC_FILL from mozjemalloc. r=njn
It's always set.

--HG--
extra : rebase_source : 1f3249a8210b0e339bda0c79932fa129cebec27a
2017-05-11 17:57:30 +09:00
Mike Hommey 9fa3e56ddf Bug 1365191 - Remove MALLOC_STATS from mozjemalloc. r=njn
It's always set.

--HG--
extra : rebase_source : 221f1b8ded2f08f0608ca065cf5029f841a4915f
2017-05-11 17:55:21 +09:00
Mike Hommey 9f69a922af Bug 1365191 - Remove MALLOC_UTRACE from mozjemalloc. r=njn
It's always unset, and Firefox has the logalloc replace-malloc library
for something similar.

--HG--
extra : rebase_source : cfe66c004df0d6e5db749f01feb9af591e3d1569
2017-05-11 17:47:02 +09:00
Mike Hommey 7a7f8c62a2 Bug 1365191 - Remove MALLOC_VALIDATE in mozjemalloc. r=njn
It's always set.

--HG--
extra : rebase_source : 926b016495867e99f8a4e22dd15f91ec4c7a1b21
2017-05-11 17:39:56 +09:00
Mike Hommey 6be3fc2ba1 Bug 1365191 - Remove !MOZ_MEMORY sections in mozjemalloc. r=njn
MOZ_MEMORY is always defined when building mozjemalloc. Due to the
origin of the code, this was all FreeBSD-specific code, and if we want
to add FreeBSD support, we will probably need to add some of it, but I'd
rather avoid keeping the difference between FreeBSD and other posix
systems if we can.

--HG--
extra : rebase_source : 3afe0136e35e25361e9e1802a9738d82b97e99e5
2017-05-11 17:34:54 +09:00
Mike Hommey 7696439eba Bug 1365191 - Remove #if 0 sections in mozjemalloc. r=njn
--HG--
extra : rebase_source : 71ff171980a1e8d629230d1d92709f0abb78199c
2017-05-11 17:23:02 +09:00
Mike Hommey cde3e9b853 Bug 1364358 - Keep track of mozjemalloc thread-local arenas. r=erahm
jemalloc_stats, as well as pre/post-fork hooks are using the `arenas`
list along the `narenas` count to iterate over all arenas setup by
mozjemalloc. Up until previous commit, that was used for automatic
multiple arenas support, which is now removed.

But mozjemalloc still supports running with multiple arenas, in the form
of opted-in, per-thread arenas. After bug 1361258, those arenas weren't
tracked, and now that `arenas` only contains the default arena, we can
now fill it with those thread-local arenas.

Keeping the automatic multiple arenas support, which we don't use and
don't really plan to, would have meant using a separate list for them.

--HG--
extra : rebase_source : f4eb55a65df8cdebff84ca709738f906d0c3c6f5
2017-05-12 21:21:11 +09:00