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

119 Коммитов

Автор SHA1 Сообщение Дата
Benjamin Smedberg ca77995f5d Bug 1333826 - Remove SDK_FILES, SDK_LIBRARY, and related is_sdk support in the build goop, r=mshal
MozReview-Commit-ID: 52vPyDXdFte

--HG--
extra : rebase_source : c3217730bb70eb7319152dd07536b12f49d6a597
2017-01-30 11:24:10 -05:00
Mike Hommey c9370d609b Bug 1332508 - Reinitialize allocator mutexes in fork() child processes. r=njn
Adapted from
4e2e3dd9cf
and
d9f7b2a430

As per the latter commit, it would seem unlocking, in fork() child
processes, mutexes that were locked in the parent process is not really
well supported on OSX 10.12. The addition of the zone_reinit_lock
function in 10.12 supports this idea.

--HG--
extra : rebase_source : b3b58558cc195d63200078085c7e9b6c9b8d83ff
2017-01-20 10:06:41 +09:00
Mike Hommey 4e8f02fe22 Bug 1286613 - Add dummy implementations for most remaining OSX zone allocator functions. r=njn
Some system libraries are using malloc_default_zone() and then using
some of the malloc_zone_* API. Under normal conditions, those functions
check the malloc_zone_t/malloc_introspection_t struct for the values
that are allowed to be NULL, so that a NULL deref doesn't happen.

As of OSX 10.12, malloc_default_zone() doesn't return the actual default
zone anymore, but returns a fake, wrapper zone. The wrapper zone defines
all the possible functions in the malloc_zone_t/malloc_introspection_t
struct (almost), and calls the function from the registered default zone
(jemalloc in our case) on its own. Without checking whether the pointers
are NULL.

This means that a system library that calls e.g.
malloc_zone_batch_malloc(malloc_default_zone(), ...) ends up trying to
call jemalloc_zone.batch_malloc, which is NULL, and crash follows.

So as of OSX 10.12, the default zone is required to have all the
functions available (really, the same as the wrapper zone), even if they
do nothing.

This is arguably a bug in libsystem_malloc in OSX 10.12, but jemalloc
still needs to work in that case.

[Adapted from
c6943acb3c]

--HG--
extra : rebase_source : 7d7a5b47fa18f56183e99c3655aee003c9be161e
2017-01-18 14:35:11 +09:00
Mike Hommey dae510ade1 Bug 1286613 - Don't rely on OSX SDK malloc/malloc.h for malloc_zone struct definitions. r=njn
The SDK jemalloc is built against might be not be the latest for various
reasons, but the resulting binary ought to work on newer versions of
OSX.

In order to ensure this, we need the fullest definitions possible, so
copy what we need from the latest version of malloc/malloc.h available
on opensource.apple.com.

[Adapted from
c68bb41793]

--HG--
extra : rebase_source : ab19c478b568ea24095a3be62c39fb81efc1920a
2017-01-18 13:50:35 +09:00
Mike Hommey e52769e834 Bug 1286613 - Use the same zone allocator implementation as replace-malloc for mozjemalloc. r=njn
We have been using a different zone allocator between mozjemalloc and
replace-malloc for a long time. Jemalloc 4 uses the same as
replace-malloc, albeit as part of the jemalloc upstream code base.

We've been bitten many times in the past with Apple changes breaking the
zone allocator, and each time we've had to make changes to the three
instances, although two of them are similar and the changes there are
straightforward.

It also turns out that the way the mozjemalloc zone allocator is set up,
when a new version of OSX appears with a new version of the system zone
allocator, Firefox ends up using the system allocator, because the zone
allocator version is not supported.

So, we use the same zone allocator for both replace-malloc and
mozjemalloc, making everything on par with jemalloc 4.

--HG--
extra : rebase_source : 9c0e245b5f82bb71294370d607e690c05cc89fbc
2017-01-18 11:45:45 +09:00
Mike Hommey d293cc01a1 Bug 1286613 - Move replace-malloc zone allocator to a separate file. r=njn
The intent here is to reuse the zone allocator for mozjemalloc, to avoid
all the shortcomings of mozjemalloc using a different one. This change
only moves the replace-malloc zone allocator out of replace-malloc.c, to
make changes for mozjemalloc integration clearer.

--HG--
rename : memory/build/replace_malloc.c => memory/build/zone.c
extra : rebase_source : 8b98efaa4a88862f2967c855b511e92beb9c4031
2017-01-18 11:39:29 +09:00
Mike Hommey 50dd84a5d8 Bug 1286613 - Properly call mozjemalloc pre/post fork hooks on OSX when replace-malloc is enabled. r=njn
Somehow, we never called those hooks when replace-malloc is enabled. I'd
expect this to cause random deadlocks when forking, and I'm surprised
this hasn't surfaced. Maybe it actually causes some intermittent oranges
on automation, who knows.

This also brings consistency with what is done for jemalloc 4, and with
the mozjemalloc implementation, too, that we're going to replace with
this one in a subsequent changeset.

--HG--
extra : rebase_source : 059567d17f928098db8367e9081b631ced351110
2017-01-19 09:37:22 +09:00
Emanuel Hoogeveen b324d2ba21 Bug 1315939 - Use FINAL_LIBRARY = 'memory' in jemalloc and mozjemalloc. r=glandium
--HG--
extra : rebase_source : 94d19e08090839537ca5174baa8b37993d108acc
2016-11-10 06:57:00 -05:00
Emanuel Hoogeveen e0a81d7503 Bug 1309573 - Part 2: Define MOZ_HAS_MOZGLUE in various places so that the crash reason gets used. r=glandium
--HG--
extra : rebase_source : d55e8dd75469759f333366bdf9662178ff0a2474
2016-11-08 03:53:00 -05:00
Emanuel Hoogeveen 8210833803 Bug 1294732 - Back out all of bug 1271165 as it has served its purpose. r=glandium 2016-08-23 08:45:00 -04:00
Emanuel Hoogeveen 581ecef4dd Bug 1271165 - Part 6: Change the new functions to MFBT_API to export them on OSX. r=jandem
--HG--
extra : rebase_source : cc3d6cd7cec9c822904364ace811d2c0dff98eff
2016-08-16 07:12:00 -04:00
Emanuel Hoogeveen 57b1d1e8f2 Bug 1271165 - Part 2: Hook the new functions up and provide dummy implementations where needed. r=ehoogeveen 2016-08-12 07:37:00 -04:00
Tom Tromey 5538d692d3 Bug 1286877 - do not set c-basic-offset for python-mode; r=gps
This removes the unnecessary setting of c-basic-offset from all
python-mode files.

This was automatically generated using

    perl -pi -e 's/; *c-basic-offset: *[0-9]+//'

... on the affected files.

The bulk of these files are moz.build files but there a few others as
well.

MozReview-Commit-ID: 2pPf3DEiZqx

--HG--
extra : rebase_source : 0a7dcac80b924174a2c429b093791148ea6ac204
2016-07-14 10:16:42 -06:00
Mike Hommey 16529670ac Bug 1284677 - Change how the default OSX malloc zone is found. r=njn
--HG--
extra : rebase_source : b5ea2bfb37047fa9f8d4d833186694407c73adda
2016-07-08 14:48:16 +09:00
Chris Peterson 8a9e2d2bd4 Bug 1272513 - Part 2: Remove redundant -Wshadow CXXFLAGS from moz.build files. r=glandium 2016-05-14 00:54:55 -07:00
Ted Mielczarek 68bd5e8c4d bug 1244743 - Replace MOZ_NATIVE_X with MOZ_SYSTEM_X. r=gps
MozReview-Commit-ID: 9ip3qeAXFEe

--HG--
extra : commitid : H6aEkHprVyX
extra : rebase_source : e20d5f4b297caf66711c72cd55dd76f7f9ef9d9c
extra : histedit_source : 47545e0ea61eb66f16545f70e6d3792a389bedb1
2016-02-01 10:49:34 -05:00
Ms2ger d1f112a81b Bug 1254948 - Remove makefiles used to transition from jemalloc_config.c to jemalloc_config.cpp; r=glandium 2016-03-10 15:53:58 +01:00
Nicholas Nethercote 57bef6b196 Bug 1232219 (part 3) - Fix remaining -Wunused warnings. r=glandium.
--HG--
extra : rebase_source : 357474b4c7729b78a3030dfefd720aad4e1b2576
2015-12-16 22:57:51 -08:00
Jan Beich 16a744dd9f Bug 1229395 - Part 2 - Rely on MALLOC_H to provide function prototypes for MOZ_NATIVE_JEMALLOC. r=glandium 2015-12-01 16:54:44 +00:00
Jan Beich 93cec6dc70 Bug 1229395 - Part 1 - Unbreak MOZ_NATIVE_JEMALLOC after bug 1141079. r=glandium 2015-12-01 16:39:33 +00:00
Mike Hommey 762aba02cd Bug 1221453 - Use ObjDirPaths for GENERATED_INCLUDES and merge with LOCAL_INCLUDES. r=gps 2015-11-06 09:59:21 +09:00
Mike Hommey 538706caba Bug 1203840 - Trigger dirty pages purge after CC. r=njn,r=smaug,r=mccr8
Jemalloc 4 purges dirty pages regularly during free() when the ratio of dirty
pages compared to active pages is higher than 1 << lg_dirty_mult.  We set
lg_dirty_mult in jemalloc_config to limit RSS usage, but it also has an impact
on performance.

So instead of enforcing a high ratio to force more pages being purged, we keep
jemalloc's default ratio of 8, and force a regular purge of all dirty pages,
after cycle collection.

Keeping jemalloc's default ratio avoids cycle-collection-triggered purge to
have to go through really all dirty pages when there are a lot, in which case
the normal jemalloc purge during free() will already have kicked in. It also
takes care of everything that doesn't run the cycle collector still having
a level of purge, like plugins in the plugin-container.

At the same time, since jemalloc_purge_freed_pages does nothing with jemalloc 4,
repurpose the MEMORY_FREE_PURGED_PAGES_MS telemetry probe to track the time
spent in this cycle-collector-triggered purge.
2015-09-20 17:43:43 +09:00
David Major cc3cd34e27 Bug 1174250: Allow the CommitHook to fail without crashing. r=glandium 2015-09-15 13:53:38 -04:00
Mike Hommey 0cf8973ede Bug 1202523 - Use the default chunk size with jemalloc 4. r=njn 2015-09-08 13:10:22 +09:00
Mike Hommey 0efccdc82c Bug 1201792 - s/MOZ_JEMALLOC3/MOZ_JEMALLOC4/. r=njn 2015-09-04 15:15:47 +09:00
Mike Hommey 748d14b77a Bug 1141079 - Setup custom jemalloc chunk hooks to keep RSS usage low. r=njn 2015-09-04 14:35:54 +09:00
Mike Hommey 4fb6c55f9d Bug 1141079 - Make jemalloc_config.c a C++ source file. r=ted
--HG--
rename : memory/build/jemalloc_config.c => memory/build/jemalloc_config.cpp
2015-09-04 14:35:54 +09:00
Jan Beich 1df901bdce Bug 1201462 - Don't count arena allocated metadata once per bin. r=glandium 2015-09-04 14:35:52 +09:00
Nicholas Nethercote f44287005f Bug 1198334 (part 1) - Replace the opt-in FAIL_ON_WARNINGS with the opt-out ALLOW_COMPILER_WARNINGS. r=glandium.
The patch removes 455 occurrences of FAIL_ON_WARNINGS from moz.build files, and
adds 78 instances of ALLOW_COMPILER_WARNINGS. About half of those 78 are in
code we control and which should be removable with a little effort.

--HG--
extra : rebase_source : 82e3387abfbd5f1471e953961d301d3d97ed2973
2015-08-27 20:44:53 -07:00
Chris Peterson 1416e566de Bug 1198124 - Enable -Wshadow in directories that have no -Wshadow warnings. r=glandium 2015-08-25 09:14:38 -07:00
Guilherme Goncalves 148b18ba80 Bug 1125514 - Use jemalloc's metadata statistics to compute bookkeeping. r=glandium 2015-08-20 10:05:44 +09:00
Birunthan Mohanathas a8939590de Bug 1182996 - Fix and add missing namespace comments. rs=ehsan
The bulk of this commit was generated by running:

  run-clang-tidy.py \
    -checks='-*,llvm-namespace-comment' \
    -header-filter=^/.../mozilla-central/.* \
    -fix
2015-07-13 08:25:42 -07:00
Mike Hommey 985ca5fd67 Bug 1168719 - Generic replace-malloc library. r=njn 2015-06-05 10:40:58 +09:00
Mike Hommey c917606f95 Bug 1043692 - Move DIST_INSTALL to moz.build. r=gps 2015-05-12 07:55:22 +09:00
Paul Rouget d60a1bd75e Bug 1156628 - Don't limit the number of unused dirty pages kept by jemalloc on B2G desktop. r=gsvelto, r=glandium 2015-04-24 03:58:00 -04:00
Mike Hommey 6dd0c8c299 Bug 762449 - Fix "result of 32-bit shift implicitly converted to 64 bits" on win64. r=njn 2015-03-02 07:35:28 +09:00
Mike Hommey 03b3291d3f Bug 1120272 - Expose _aligned_alloc and _aligned_free from mozglue. r=njn 2015-01-20 13:10:00 +09:00
Masatoshi Kimura bf312ad056 Bug 1120062 - Part 1: Remove most Nullptr.h includes. r=waldo 2015-01-11 11:34:52 +09:00
Brad Lassey 0e7333b6e7 bug 1083116 - build fails: malloc_decls.h conflicting types for 'malloc_usable_size' r=glandium 2015-01-06 19:58:36 -05:00
Guilherme Goncalves c6a10e7bb5 Bug 899126 - Part 2 - Measure bookkeeping in jemalloc3. r=glandium. 2014-12-29 13:42:14 -08:00
Jan Beich f4828d35f5 Bug 1115078 - Unbreak MOZ_JEMALLOC3 build on FreeBSD after bug 899126. r=glandium 2014-12-23 12:32:00 -05:00
Guilherme Goncalves 1fb7597a1b Bug 1110514 - Use arena.<i>.purge to free jemalloc3's dirty pages. r=glandium 2014-12-23 02:41:00 -05:00
Guilherme Goncalves 802cb55877 Bug 1108045 - Junk memory with jemalloc3. r=glandium 2014-12-23 07:44:00 -05:00
Guilherme Goncalves f9d70a5255 Bug 762448 - Bump opt.lg_dirty_mult in jemalloc3 to reduce number of dirty pages. r=glandium 2014-12-23 06:01:00 -05:00
Guilherme Goncalves 5ff0106324 Bug 762448 - Deduct bin_unused from waste in jemalloc3's stats. r=glandium 2014-11-12 13:00:00 -05:00
Ryan VanderMeulen 42a3e6c0ea Merge m-c to inbound. a=merge 2014-12-23 13:18:02 -05:00
Vladimir Vukicevic a910628209 Bug 1112566 - Use jemalloc C99 msvc compat headers when building mozjemalloc compat glue and jemalloc3 replace-malloc library. r=glandium 2014-12-23 15:27:18 +09:00
Guilherme Goncalves 22c6a4800b Bug 899126 - Part 1: Implement bin_unused for jemalloc3. r=glandium 2014-12-19 09:15:00 -05:00
Guilherme Goncalves 60eb32a82c Bug 1094275 - Update the in-tree copy of jemalloc3 to commit b4acf73. r=glandium 2014-12-17 09:14:48 +09:00
Mike Hommey c04636bda3 Bug 1104173 - Properly export jemalloc_* symbols from the jemalloc3 replace-malloc library. r=njn
Bug 818922 made MOZ_REPLACE_MALLOC a global define, and that changed the
defines set when building mozjemalloc_compat.c for the jemalloc3
replace-malloc library. In turn, this made the symbol munging wrong for
that library, making the jemalloc_* functions exported as je_jemalloc_*
instead of replace_jemalloc_*.
2014-11-26 16:04:25 +09:00