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

711 Коммитов

Автор SHA1 Сообщение Дата
Wes Kocher 017c515285 Merge inbound to m-c a=merge
MozReview-Commit-ID: IKI0zVtF1n9
2017-02-15 16:18:13 -08:00
Emanuel Hoogeveen 00c7d04549 Bug 1339441 - Take the arena lock earlier in arena_dalloc(). r=glandium
--HG--
extra : rebase_source : 95e8f744a9f77381270fd8f8942765b144b844a2
2017-02-15 09:48:00 -05:00
Sylvestre Ledru 6fd3084f65 Bug 1338086 - Remove useless else blocks in order to reduce complexity in memory/ r=njn
MozReview-Commit-ID: G7jBKlDHshQ

--HG--
extra : rebase_source : 4317651e0cc87b0be1230b19ceb844cfcb4842bc
2017-02-09 11:24:39 +01:00
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
Dimitry Andric 8b0557b033 Bug 1329520 - Fix "memory/mozalloc/throw_gcc.h:35:1: note: declaration missing '[[noreturn]]' (libc++ 4.0)" r=nfroyd 2017-01-27 13:55:00 +01: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 dbc87ab49d Bug 1286613 - Update jemalloc 4 to c6943ac. r=njn
This picks the same changes as the ones we just did to
memory/build/zone.c, plus a oneliner for sparc64.

--HG--
extra : rebase_source : ca917461472e8188fbfc6e2a971b228b68014e38
2017-01-18 15:47:53 +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
John Paul Adrian Glaubitz 4b76f57494 Bug 1275204 - mozjemalloc: Use the JS arm64 allocator on Linux/sparc64. r=glandium 2017-01-11 16:09:39 +09:00
John Paul Adrian Glaubitz dbf939ff1d Bug 1275204 - mozjemalloc: Use better pre-processor defines for sparc64. r=glandium 2017-01-11 16:05:53 +09:00
Ryan VanderMeulen ab68dae81c Bug 1200951 - Use the same poison patterns for jemalloc4 as mozjemalloc. r=glandium
--HG--
extra : rebase_source : c44d6020934f16e53ce1c3553c5f952981bceb03
2017-01-10 22:50:36 -05:00
Ryan VanderMeulen 7d537bf11a Bug 1322027 - Update jemalloc 4 to version 4.4.0. r=glandium
--HG--
extra : rebase_source : acad2186ad3ace467a626fcf38659aaf6708c96b
2017-01-10 22:50:36 -05:00
Chris Peterson b9fd4f1b11 Bug 1142403 - Part 3: jemalloc4 no longer requires ctl.c to be built in non-unified mode in debug builds. r=glandium
--HG--
extra : rebase_source : 9c1e00514be306552722ebd855d364b9b98b5c87
2016-12-22 18:54:59 -08:00
Mike Hommey bbde532853 Bug 1142403 - Part 1: Don't build jemalloc4 with unified sources when built with --enable-debug. r=mshal
When built with --enable-debug, jemalloc4 makes headers define functions that
are normally inlined, and that prevents unified sources from working.

--HG--
extra : rebase_source : 9490a0a8312e9be18e639384e3450a9c924e3daf
extra : source : a67867200ec31a040bb6bf8320bde20beb34aa3e
2015-08-12 16:04:53 +09:00
Mike Hommey d1c271f02d Bug 1321093 - Avoid logalloc-replay make check failure when libstdc++ allocates memory in some static initializer. r=njn
--HG--
extra : rebase_source : 83ef3414b74a5164b8535bdf266075d1076e0437
2016-11-30 07:22:20 +09:00
Mike Hommey 97ae022e70 Bug 1311039 - Properly detect the default malloc zone on OSX 10.12. r=njn
--HG--
extra : rebase_source : e625875064e051fa931cab5827debe9fd02d91cf
2016-11-03 10:02:06 +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
Eric Rahm 2faeed6d55 Bug 1313485 - Convert XPCOM test TestJemalloc to a gtest. r=njn
MozReview-Commit-ID: 5yzn8o33Ne5

--HG--
rename : xpcom/tests/TestJemalloc.cpp => memory/gtest/TestJemalloc.cpp
2016-11-09 10:24:22 -08:00
Ryan VanderMeulen 3445ad743b Bug 1277704 - Update jemalloc 4 to version 4.3.1. r=glandium
--HG--
extra : rebase_source : d8c50b1012085fad8d7bd940abb41d51423bc12c
2016-07-12 10:37:04 -04: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
Sebastian Hengst 193fc03fc6 Backed out changeset 1b545e55e42a (bug 1313485) for bustage. r=backout
--HG--
rename : memory/gtest/TestJemalloc.cpp => xpcom/tests/TestJemalloc.cpp
2016-11-07 23:46:09 +01:00
Eric Rahm 52ba7f5179 Bug 1313485 - Convert XPCOM test TestJemalloc to a gtest. r=njn
MozReview-Commit-ID: 5yzn8o33Ne5

--HG--
rename : xpcom/tests/TestJemalloc.cpp => memory/gtest/TestJemalloc.cpp
2016-11-07 14:26:25 -08:00
Mike Hommey 97f635df6b Bug 1303232 - Use per-process reduced thread-ids when munging logalloc logs. r=njn
Bug 1300948 added thread-ids to logalloc logs, and logalloc_munge.py was
munging them all as if they were all under the same namespace. But when
filtering munged logs to only contain logs from a given process,
thread-ids then don't necessarily start from 1, which would be the
desired outcome.

So use a different pool of thread-ids for each process.
2016-09-20 13:44:27 +09:00
Mike Hommey 7e7b4f9fe6 Bug 1300974 - Work around race condition leading to deadlock on fork when enabling LogAlloc. r=njn 2016-09-08 07:56:02 +09:00
Mike Hommey 39fe86c4ed Bug 1300948 - Add thread identifier to LogAlloc output. r=njn 2016-09-08 07:55:03 +09:00
Cameron McCormack 072d6a1fbe Bug 1291356 - Enable multiple jemalloc arenas for MOZ_STYLO builds. r=me
--HG--
extra : rebase_source : eaaaf6fd3aad8a99c7032ce55a1d351f2bf80af1
2016-08-26 20:21:48 +09:00
Wes Kocher 50954c6f31 Merge m-c to autoland, a=merge 2016-08-25 17:15:05 -07: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
Andrew McCreight 5772f60634 Bug 1295695 - Add maybe_pod_* methods to InfallibleAllocPolicy. r=glandium
Bug 1207519 added maybe_pod_* methods to the allocation policy
classes, but did not add them to InfallibleAllocPolicy.

I think the idea of these methods is that the callers are explicitly
opting into fallible behavior, so they will deal with any errors that
occur. For instance, in js::HashTable, this is used to try to shrink
the hash table when there are a lot of unused entries. If the shrink
fails, it just continues to use the existing block of memory.

However, having fallible methods in a supposedly infallible class is
weird, so for now, just use the infallible version.

MozReview-Commit-ID: 97D66Z4oLfl

--HG--
extra : rebase_source : 9a3e0b50a5602a8e4772da88c16e1715c25da7df
2016-08-16 11:09:05 -07:00
Ryan VanderMeulen 69113163cf Merge m-c to inbound. a=merge 2016-08-24 09:09:05 -04:00
Andrew McCreight faa1eb2316 Bug 1295688 - InfallibleAllocPolicy should crash on overflow. r=glandium
Code that uses InfallibleAllocPolicy presumably wants for operations
to always succeed. However, Vector and HashTable can end up detecting
that growing the data structure will fail due to integer overflow, and
then will call reportAllocOverflow() and fail. I think these cases
should crash.

In addition, pod_malloc and pod_realloc should crash rather than
returning NULL when they detect overflow.

This calls mozalloc_abort rather than MOZ_CRASH directly to avoid
circular #includes, because Assertions.h includes nsTraceRefcnt.h
which includes nscore.h which includes mozalloc.h.

MozReview-Commit-ID: 1g99BXLceQI

--HG--
extra : rebase_source : 927d842588c1f85a50a7a1c50a5546d5f688555f
2016-08-16 10:56:14 -07:00
Kan-Ru Chen b6d880aca1 Bug 1297276 - Rename mfbt/unused.h to mfbt/Unused.h for consistency. r=froydnj
The patch is generated from following command:

  rgrep -l unused.h|xargs sed -i -e s,mozilla/unused.h,mozilla/Unused.h,

MozReview-Commit-ID: AtLcWApZfES


--HG--
rename : mfbt/unused.h => mfbt/Unused.h
2016-08-24 14:47:04 +08: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 f7bdbc26ad Bug 1271165 - Part 4: Enable the new functionality in mozjemalloc. r=ehoogeveen 2016-08-12 07:38: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
Emanuel Hoogeveen 506ca1034e Bug 1271165 - Part 1: Add protected allocation functions and supporting infrastructure to mozjemalloc. r=ehoogeveen 2016-08-12 07:36:00 -04:00
Emanuel Hoogeveen 54e158268e Bug 1271165 - Part 0: Strip trailing blanks from mozjemalloc. r=ehoogeveen 2016-08-12 07:36:00 -04:00
Alexandre Lissy 0af5b943b6 Bug 1284674 - Remove NUWA r=cyu
MozReview-Commit-ID: GyMRNzOBKw6

--HG--
extra : rebase_source : 293af1cd55f2035ce6a99f4ebf144059c32a2b8f
2016-08-02 14:54:00 +02:00
Chris Peterson 6229606616 Bug 1290645 - Remove VS2013 workarounds in memory/. r=glandium 2016-07-28 11:46:30 -07: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 63e7e7ede4 Bug 1280578 - Wrap HeapAlloc, HeapFree and HeapReAlloc on Windows. r=njn
The Win32 has non-malloc based heap allocation functions. They are not
widely used in the Gecko code base, but there are a few places that do
use them. They could be replaced with uses of malloc/free/realloc or
new/delete, but there is now an entirely separate problem that
requires wrapping those functions: the Rust static libraries are using
those functions to allocate memory.
2016-07-20 14:04:40 +09:00
Nicholas Nethercote 6f4e7b36f5 Bug 1282185 (part 2) - Fix an assertion failure in DMD. r=erahm.
--HG--
extra : rebase_source : cb2ae2a5a6fdc84bbcaba64759b0dbce1e161249
2016-07-13 19:32:27 +10:00
Nicholas Nethercote dcf407f2a8 Bug 1282185 (part 1) - Remove a bogus assertion in DMD. r=erahm.
Since bug 1253512 landed, it's possible for DeadBlocks to lack an allocation
stack.

--HG--
extra : rebase_source : 0efc60192ed0992d2f68838d95586cd888765586
2016-07-13 18:10:56 +10: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
Bill McCloskey 308608ab39 Bug 1262671 - Introduce MFBT BufferList class (r=froydnj) 2016-05-27 09:57:40 -07:00
Mike Hommey 8855262939 Bug 1269171 - Change how mozalloc.h is hooked in STL wrappers. r=froydnj
Since the introduction of the STL wrappers, they have included
mozalloc.h, and multiple times, we've hit header reentrancy problems,
and worked around them as best as we could.

Taking a step back, all mozalloc.h does is:
- declare moz_* allocator functions.
- define inline implementations of various operator new/delete variants.

The first only requires the functions to be declared before they are used,
so mozalloc.h only needs to be included before anything that would use
those functions.

The second doesn't actually require a specific order, as long as the
declaration for those functions comes before their use, and they are
either declared in <new> or implicitly by the C++ compiler.

So all in all, it doesn't matter that mozalloc.h is included before the
wrapped STL headers. What matters is that it's included when STL headers
are included. So arrange things such that mozalloc.h is included after
the first wrapped STL header is fully preprocessed (and all its includes
have been included).
2016-05-22 08:32:40 +09:00