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

1408 Коммитов

Автор SHA1 Сообщение Дата
Christian Holler 4cbcb23e42 Bug 1587066 - Use native abort() for ThreadSanitizer. r=jseward
Differential Revision: https://phabricator.services.mozilla.com/D48532

--HG--
extra : moz-landing-system : lando
2019-10-09 14:27:21 +00:00
Sylvestre Ledru f12b9fa5c3 Bug 1519636 - Reformat recent changes to the Google coding style r=Ehsan
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D47737

--HG--
extra : moz-landing-system : lando
2019-10-06 18:29:55 +00:00
Nathan Froyd b47e23e17a Bug 1411613 - mark certain allocation functions as non-throwing; r=glandium
glibc marks various allocation functions as `throw()`.  This addition
hasn't been a problem until we tried to enable C++17, where clang
started complaining that we were redeclaring functions with mismatched
exception specifications.  Peculiarly, glibc declares virtually
everything we redeclare as `throw()`, but clang only complains about the
mismatches for a particular subset of functions.

The approach taken in this patch is to add another potentially defined
macro to malloc_decls.h, `NOTHROW_MALLOC_DECL`.  This macro works
exactly like `MALLOC_DECL`, except that clients can define
`NOTHROW_MALLOC_DECL` to add appropriate `throw()` specifiers when
declaring functions at global scope, and thereby avoid mismatched
exception specifications.

Differential Revision: https://phabricator.services.mozilla.com/D44045

--HG--
extra : moz-landing-system : lando
2019-09-04 23:40:15 +00:00
Tom Ritter 1f279f7006 Bug 1547519 - Fix jemalloc redirections for MinGW build r=glandium
In the MinGW build, calls to malloc inside mozglue were not being
redirected as defined in the .def file. We create aliases for the
redirected functions to correctly redirect them inside mozglue.

An alternate solution for this exists. Rather than creating the
importlib during the linking step for mozglue, we could have used
dlltool to create it, and then provided it during linking. This
would allow mozglue to know that it should redirect calls to malloc
to je_malloc as specified in the .def file.

Differential Revision: https://phabricator.services.mozilla.com/D38407

--HG--
extra : moz-landing-system : lando
2019-09-04 02:40:08 +00:00
Nicholas Nethercote adb9edf389 Bug 1574388 - Implement PHC on Mac. r=gsvelto,glandium
But it is not yet enabled; bug 1576515 will do that.

Differential Revision: https://phabricator.services.mozilla.com/D42264

--HG--
extra : moz-landing-system : lando
2019-08-25 23:16:05 +00:00
Sylvestre Ledru 645f2d5773 Bug 1519636 - Reformat recent changes to the Google coding style r=Ehsan
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D41559

--HG--
extra : moz-landing-system : lando
2019-08-13 07:15:25 +00:00
Mike Hommey c159931fbc Bug 1571505 - Properly add dbghelp where needed. r=nalexander
While here, properly export StackWalk.h when building with
--enable-project=memory.

Differential Revision: https://phabricator.services.mozilla.com/D40731

--HG--
extra : moz-landing-system : lando
2019-08-06 18:14:12 +00:00
Cameron McCormack d075470483 Bug 1053379 - Simplify CodeAddressService so non-DMD users can rely on defaults. r=njn
None of the StringTable implementations were freeing their strdup'd
strings, either.

Differential Revision: https://phabricator.services.mozilla.com/D40757

--HG--
extra : moz-landing-system : lando
2019-08-06 21:58:12 +00:00
Nicholas Nethercote e38691d6e6 Bug 1569862 - Implement PHC on Windows. r=glandium
The most important part is the `GetPHCAddrInfo()` function in
`exception_handler.cc`, which extracts a crash address from an
`EXCEPTION_POINTERS` object.

The commit also changes the code so that it works if MozStackWalk() returns an
empty stack trace. This happens in practice on Windows on automation sometimes,
I'm not sure why.

The rest of the commit is just plumbing and the smoothing over of minor
platform differences.

Differential Revision: https://phabricator.services.mozilla.com/D39841

--HG--
extra : moz-landing-system : lando
2019-08-02 00:33:04 +00:00
Mihai Alexandru Michis 13fa935d68 Backed out changeset b1faa1af2967 (bug 1546442) for causing a spike in bug 1475812 and bug 1471001 a=backout 2019-07-26 00:15:37 +03:00
Gian-Carlo Pascutto 08c4b524cb Bug 1546442 - Leading guard pages for normal allocations. r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D28516

--HG--
extra : moz-landing-system : lando
2019-07-25 09:22:47 +00:00
Nicholas Nethercote 38dbbfcffc Bug 1523276 - Implement PHC, a probabilistic heap checker. r=glandium,gsvelto
Differential Revision: https://phabricator.services.mozilla.com/D25021

--HG--
extra : rebase_source : 86e94499f746b18a596130341692c6a9992d4867
2019-07-03 09:26:11 +10:00
Jed Davis ffe4e7333c Bug 1562358 - Move fallible.h into MFBT. r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D36541

--HG--
rename : memory/fallible/fallible.h => mfbt/fallible.h
extra : moz-landing-system : lando
2019-07-10 01:51:15 +00:00
Csoregi Natalia f30f0ab1f3 Backed out changeset 5bf39249f6e4 (bug 1562358) for spidermonkey bustage. CLOSED TREE
--HG--
rename : mfbt/fallible.h => memory/fallible/fallible.h
2019-07-09 19:26:58 +03:00
Jed Davis f0628ffad3 Bug 1562358 - Move fallible.h into MFBT. r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D36541

--HG--
rename : memory/fallible/fallible.h => mfbt/fallible.h
extra : moz-landing-system : lando
2019-07-02 09:08:21 +00:00
Victor Porof feaa92296b Bug 1561435 - Format memory/, a=automatic-formatting
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D35912

--HG--
extra : source : ae1388f34f73a8628d46d49ca0de9577a20bf650
2019-07-05 10:51:11 +02:00
Nick Thomas 1048178580 Bug 1559975 - enable py2 and py3 linting in memory r=ahal
Differential Revision: https://phabricator.services.mozilla.com/D35251

--HG--
extra : moz-landing-system : lando
2019-06-28 18:53:28 +00:00
Mike Hommey 8b2a1911b2 Bug 1559379 - Export C++ allocation functions from mozglue on all platforms. r=froydnj
- On Android, we were already doing it, but using fallible allocations.
- On *nix, it probably doesn't make a difference, but can't hurt. For
  most things in Gecko, operator new/delete are inlined and thus
  replaced by direct calls to the underlying allocator functions
  (moz_xmalloc, malloc, etc.). This may have a benefit for some third
  party libraries that would otherwise go through libstdc++'s to
  eventually end up back into our allocator via the zone allocator
  on macOS and via the exported symbols on others.
- On Windows, because of how some CRT static libraries are, a non-inlined
  operator new (thanks to some disabled STL wrapping) would end up linked
  against the system malloc, causing problems.

Overall, this can only be better. This also reduces the number of places
where we define those functions.

And on Android, this means operator new within mozglue becomes infallible,
which is more consistent with everything else.

Differential Revision: https://phabricator.services.mozilla.com/D36166

--HG--
extra : moz-landing-system : lando
2019-06-27 22:07:42 +00:00
Mike Hommey d02ba318e0 Bug 1559379 - Remove GCC ASAN workaround that seems to be unnecessary nowadays. r=froydnj
Bug 1147248 added the workaround for GCC 4.9, but from an attempt with
GCC 6, it seems unnecessary anymore.

Differential Revision: https://phabricator.services.mozilla.com/D36165

--HG--
extra : moz-landing-system : lando
2019-06-27 22:07:44 +00:00
Andreea Pavel f145bcfd98 Backed out 2 changesets (bug 1559379) for SM build bustages on a CLOSED TREE
Backed out changeset 0defd54899e2 (bug 1559379)
Backed out changeset ee4f23ea8530 (bug 1559379)
2019-06-28 01:03:23 +03:00
Mike Hommey 52dc935c68 Bug 1559379 - Export C++ allocation functions from mozglue on all platforms. r=froydnj
- On Android, we were already doing it, but using fallible allocations.
- On *nix, it probably doesn't make a difference, but can't hurt. For
  most things in Gecko, operator new/delete are inlined and thus
  replaced by direct calls to the underlying allocator functions
  (moz_xmalloc, malloc, etc.). This may have a benefit for some third
  party libraries that would otherwise go through libstdc++'s to
  eventually end up back into our allocator via the zone allocator
  on macOS and via the exported symbols on others.
- On Windows, because of how some CRT static libraries are, a non-inlined
  operator new (thanks to some disabled STL wrapping) would end up linked
  against the system malloc, causing problems.

Overall, this can only be better. This also reduces the number of places
where we define those functions.

And on Android, this means operator new within mozglue becomes infallible,
which is more consistent with everything else.

Differential Revision: https://phabricator.services.mozilla.com/D36166

--HG--
extra : moz-landing-system : lando
2019-06-27 14:01:31 +00:00
Mike Hommey 2c90fad39d Bug 1559379 - Remove GCC ASAN workaround that seems to be unnecessary nowadays. r=froydnj
Bug 1147248 added the workaround for GCC 4.9, but from an attempt with
GCC 6, it seems unnecessary anymore.

Differential Revision: https://phabricator.services.mozilla.com/D36165

--HG--
extra : moz-landing-system : lando
2019-06-27 13:37:36 +00:00
Tom Ritter 0b01745031 Bug 1376408 - Randomize free region selection for small allocations in a run r=glandium
This allows freelist randomization on a per-arena basis, by supplying parameters to
arena creation.

It uses an xorshift PRNG with a 128-bit state. It is not cryptographically secure. An
attacker who can observe outputs of the RNG, or read its state, is already in a position
to bypass the randomization applied. At the same time we make its state 128 bit to prevent
a trivial bypass if one or two outputs are observed.

The way a run selects masks to check has not been modified, so the randomization is limited
to at most 32 bits in the current mask being tested. It should be noted that while allocations
from the same run may now be non deterministic (up to the maximum entropy as previously
stated), an attacker who can perform multiple allocations will still be able to allocate
a targeted free region (for example while exploiting a use after free vulnerability in the
DOM). Non deterministic allocations will only impede an attacker who has less control over
how they allocate a targeted free region, and may provide some benefit during exploitation
of a heap based buffer overflow vulnerability where the attacker wishes to construct a
precise layout of regions pre overflow.

Differential Revision: https://phabricator.services.mozilla.com/D32219

--HG--
extra : moz-landing-system : lando
2019-06-18 21:18:23 +00:00
Nicholas Nethercote 94ec493862 Bug 1557907 - Fix `jemalloc_replace_dynamic()`. r=glandium
`jemalloc_replace_dynamic()` is badly broken. If you install a malloc table
other than the default at startup (e.g. DMD's or PHC's), when you call
`jemalloc_replace_dynamic()` it installs a new allocator that wraps the
*default* allocator, and then when you call `jemalloc_replace_dynamic(nullptr)`
it switches back to the *default* allocator.

This commits makes numerous improvements.

- It removes the "flip-flopping" between malloc tables, which didn't really
  work and isn't necessary.

- `jemalloc_replace_dynamic()` now switches between the *original* malloc table
  and the new one, rather than the *default* malloc table and the new one.

- It renames various things, to make the names shorter and clearer.

- It clearly documents the dangers and limitations of
  `jemalloc_replace_dynamic()`.

- It removes and inlines `profiler::Init()`, because there was only one call
  site.

- It rearranges `install_memory_counter()` so the control flow is simpler.

Differential Revision: https://phabricator.services.mozilla.com/D34266

--HG--
extra : moz-landing-system : lando
2019-06-13 20:42:19 +00:00
Nicholas Nethercote 637456901b Bug 1558365 - Simplify `PtrInfoTag`. r=glandium
This makes it less mozjemalloc-specific, which is helpful for PHC. No non-test
code uses the extra detail anyway.

Differential Revision: https://phabricator.services.mozilla.com/D34441

--HG--
extra : moz-landing-system : lando
2019-06-12 07:38:30 +00:00
Mike Hommey a36bd5ae07 Bug 997353 - Make powerpc not use static page sizes in mozjemalloc. r=njn
__powerpc__ covers powerpc and powerpc64.

Differential Revision: https://phabricator.services.mozilla.com/D33750

--HG--
extra : moz-landing-system : lando
2019-06-06 05:25:59 +00:00
Mike Hommey 2abcc3d7cb Bug 1553363 - Generalize the *_impl goop for allocation functions in mozglue. r=froydnj
The current situation is suboptimal, where we have the same goop
repeated in multiple files, and where things kinda sorta work out fine
thanks to the linker for files that would have been forbidden, except
when the linker doesn't do its job, which apparently happen on
mingwclang builds.

This change only really covers C++ code using operator new/delete, and
not things that would be using malloc/free, because it's easier.
malloc/free is left for a followup.

Differential Revision: https://phabricator.services.mozilla.com/D32119

--HG--
extra : moz-landing-system : lando
2019-05-29 22:49:42 +00:00
Mike Hommey 4a87ec2ddc Bug 1553058 - Remove unused gPageSize case. r=njn
MALLOC_STATIC_PAGESIZE is only set on some platforms. Specifically, it's
not set on ia64 and sparc. Which means the case MALLOC_STATIC_PAGESIZE
&& (sparc || ia64) never happens, and gPageSize is never 8 KiB.

Differential Revision: https://phabricator.services.mozilla.com/D31965

--HG--
extra : moz-landing-system : lando
2019-05-21 23:01:21 +00:00
Chris Martin 7d1181258d Bug 1052579 - Modify GTest for jemalloc_ptr_info() to check arenaId r=glandium
In D25711, I added an arenaId member to `jemalloc_ptr_info_t` when `MOZ_DEBUG`
is defined. This modifies the GTest for `jemalloc_ptr_info()` to ensure that
the new member returns the correct value.

Differential Revision: https://phabricator.services.mozilla.com/D30087

--HG--
extra : moz-landing-system : lando
2019-05-07 00:34:42 +00:00
Gian-Carlo Pascutto 3c771d5a8b Bug 1537781 - Test for trailing guard pages for normal allocations. r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D27913

--HG--
extra : moz-landing-system : lando
2019-05-02 14:19:19 +00:00
Gian-Carlo Pascutto 3b43637e56 Bug 1537781 - Trailing guard pages for normal allocations. r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D27912

--HG--
extra : moz-landing-system : lando
2019-05-02 14:19:17 +00:00
Sylvestre Ledru e226046cb8 Bug 1547143 - Format the tree: Be prescriptive with the pointer style (left) r=Ehsan
# ignore-this-changeset

Depends on D28954

Differential Revision: https://phabricator.services.mozilla.com/D28956

--HG--
extra : moz-landing-system : lando
2019-05-01 08:47:10 +00:00
Chris Martin ef8ae4fcb3 Bug 1052579 - Add ability to query ArenaID to mozjemalloc_ptr_info r=glandium
To ensure that any new JSString has its char buffer allocated in the new arena,
it is useful to be able to query a pointer and assert that it is in the
correct arena (at-least in Debug Build).

This adds the required functionality to mozjemalloc, and JSString can use it
for its new assertion in a later change.

Differential Revision: https://phabricator.services.mozilla.com/D25711

--HG--
extra : moz-landing-system : lando
2019-04-23 12:39:58 +00:00
Edwin Gao 9994405ece Bug 1544961 - comment on gtests that are disabled, disable ThreadUtils.IdleRunnableMethod and Timers.FindExpirationTime for windows10-aarch64 r=jmaher,gbrown,dmajor
Changes:
- added comments for tests being disabled
- disabled two additional tests in order to green the run

Differential Revision: https://phabricator.services.mozilla.com/D28085

--HG--
extra : moz-landing-system : lando
2019-04-23 00:21:37 +00:00
Narcis Beleuzu cd1fcbc396 Backed out changeset 497561b76737 (bug 1052579) for bustages on mozjemalloc_types.h . CLOSED TREE 2019-04-22 19:00:58 +03:00
Chris Martin cb3f697d99 Bug 1052579 - Add ability to query ArenaID to mozjemalloc_ptr_info. r=glandium
To ensure that any new JSString has its char buffer allocated in the new arena,
it is useful to be able to query a pointer and assert that it is in the
correct arena (at-least in Debug Build).

This adds the required functionality to mozjemalloc, and JSString can use it
for its new assertion in a later change.

Differential Revision: https://phabricator.services.mozilla.com/D25711
2019-04-02 03:55:06 +00:00
Edwin Gao 4b2a06ae0f Bug 1544961 - disable tests that cause gtest harness to crash on windows10-aarch64 r=jmaher,gbrown
Changes:
- most tests are skipped using `moz.build` configuration file.
- `MultiWriterQueue` had to be skipped with `define` clauses in the test file due to build bustages when its `moz.build` file was used.

Differential Revision: https://phabricator.services.mozilla.com/D27944

--HG--
extra : moz-landing-system : lando
2019-04-17 23:12:19 +00:00
Gian-Carlo Pascutto bfcbc83c13 Bug 1542290 - Decommit unused base_page allocations. r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D26327

--HG--
extra : moz-landing-system : lando
2019-04-16 11:04:21 +00:00
Sylvestre Ledru 7f60810d86 Bug 1519636 - Reformat recent changes to the Google coding style r=Ehsan
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D27245

--HG--
extra : moz-landing-system : lando
2019-04-12 13:14:25 +00:00
Geoff Brown 7897534073 Bug 1318091 - Skip jemalloc gtests on android; r=bc
The jemalloc tests leave behind minidumps. Disable for now, for a green run.

Differential Revision: https://phabricator.services.mozilla.com/D27014

--HG--
extra : moz-landing-system : lando
2019-04-11 10:57:50 +00:00
Petr Sumbera a65de26d20 Bug 1542758 - mozjemalloc.cpp should use posix_madvise on Solaris r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D26529

--HG--
extra : moz-landing-system : lando
2019-04-09 08:20:48 +00:00
Sylvestre Ledru 03fc65347c Bug 1542146 - Apply the change with the option StatementMacros from clang-format-8 r=andi
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D26280

--HG--
extra : moz-landing-system : lando
2019-04-05 21:42:17 +00:00
Csoregi Natalia ba58e936bd Backed out changeset 4ad80127f89f (bug 1519636) for bustage on MarkupMap.h and nsAccessibilityService.cpp. CLOSED TREE 2019-04-05 09:48:19 +03:00
Sylvestre Ledru d1c1878603 Bug 1519636 - clang-format-8: Reformat recent changes to the Google coding style r=Ehsan
clang-format-8 upstream had some improvements wrt macros
See: https://reviews.llvm.org/D33440
This is why the diff is bigger than usual

# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D26098

--HG--
extra : moz-landing-system : lando
2019-04-04 21:36:16 +00:00
Narcis Beleuzu 24dbe577a5 Backed out changeset 389b6bbd76db (bug 1519636) for bustages on MarkupMap.h . CLOSED TREE 2019-04-05 00:27:56 +03:00
Sylvestre Ledru 399dbd28fe Bug 1519636 - clang-format-8: Reformat recent changes to the Google coding style r=Ehsan
clang-format-8 upstream had some improvements wrt macros
See: https://reviews.llvm.org/D33440
This is why the diff is bigger than usual

# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D26098

--HG--
extra : moz-landing-system : lando
2019-04-04 20:12:23 +00:00
Nicholas Nethercote 653456467a Bug 1533240 - Replace DMD's custom TLS code with use of mozilla/ThreadLocal.h. r=erahm
Differential Revision: https://phabricator.services.mozilla.com/D22448

--HG--
extra : moz-landing-system : lando
2019-03-22 20:07:30 +00:00
Gian-Carlo Pascutto d735d8aa70 Bug 1529922 - Add guard pages following huge allocations. r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D23292

--HG--
extra : moz-landing-system : lando
2019-03-20 10:45:15 +00:00
Edwin Gao b0ed46de2e Bug 1536250 - disable test_dmd.js r=jmaher
Disable this test which intermittently fails in xpcshell.

Differential Revision: https://phabricator.services.mozilla.com/D23956

--HG--
extra : moz-landing-system : lando
2019-03-19 01:12:08 +00:00
Gurzau Raul 0f47ac1ab9 Backed out changeset 46f6705f9c0c (bug 1533240) for xpcshell failures at /test/test_dmd.js on a CLOSED TREE. 2019-03-14 07:03:38 +02:00
Nicholas Nethercote f3a720ae86 Bug 1533240 - Replace DMD's custom TLS code with use of mozilla/ThreadLocal.h. r=erahm
Differential Revision: https://phabricator.services.mozilla.com/D22448

--HG--
extra : moz-landing-system : lando
2019-03-14 01:05:15 +00:00
David Major e5773183d6 Bug 1528074 - Remove MSVC warning flags that clang-cl doesn't understand r=chmanchester
Per the previous patch, clang-cl only understands five MSVC-style warning flags: 7219c7e9af/clang/include/clang/Driver/CLCompatOptions.td (L188-L197)

This patch removes the flags that clang-cl doesn't understand.

Differential Revision: https://phabricator.services.mozilla.com/D22588

--HG--
extra : moz-landing-system : lando
2019-03-13 20:19:08 +00:00
Ryan Hunt bc6f68363a Bug 1523969 part 16 - Move method definition inline comments to new line in 'memory/'. r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D21117

--HG--
extra : rebase_source : 73bb987caf0e10f7168610a3d6d3b993afeb7dd3
2019-02-25 16:10:15 -06:00
Nicholas Nethercote e01d4bc8cc Bug 1531027 - Add an explicit copy constructor to StackTrace. r=ehsan
This only copies the first `mLength` elements in `mPcs`.

Differential Revision: https://phabricator.services.mozilla.com/D21488

--HG--
extra : rebase_source : 91601501056fe7ea5b011adeca59033568fbde4a
2019-02-28 11:00:14 +11:00
Nicholas Nethercote 3494926e55 Bug 1531029 - Fix incorrect `sizeof` expression. r=ehsan
This doesn't change behaviour because `sizeof(uintptr_t)` equals
`sizeof(uintptr_t*)`, but it's good to make things more obviously correct.

Differential Revision: https://phabricator.services.mozilla.com/D21487

--HG--
extra : rebase_source : 4df36d1d1e85a671c297e6e761b44b7da5b85343
2019-02-28 11:05:34 +11:00
Ehsan Akhgari 1ca16ce872 Bug 1531027 - Make InfallibleAllocPolicy::new_ accept its argument as a reference; r=njn
Differential Revision: https://phabricator.services.mozilla.com/D21486

--HG--
extra : moz-landing-system : lando
2019-02-28 06:41:09 +00:00
Mike Hommey 9ca5062588 Bug 1530562 - Set SmokeDMD compiler flags depending on compiler type rather than target OS. r=mshal
Differential Revision: https://phabricator.services.mozilla.com/D21161

--HG--
extra : moz-landing-system : lando
2019-02-26 22:06:37 +00:00
Nicholas Nethercote 06e15020fe Bug 1529452 - Fix a silly bug. r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D20772

--HG--
extra : moz-landing-system : lando
2019-02-22 10:52:03 +00:00
Jeff Gilbert ec5431c0a2 Bug 1349064 - Wrap std::regex_error for GCC. r=glandium 2019-02-21 11:23:59 -08:00
Nicholas Nethercote 4e8b423a96 Bug 1529452 - Avoid a multiplication that could overflow. r=glandium
Also add a comment about another multiplication.

Differential Revision: https://phabricator.services.mozilla.com/D20617

--HG--
extra : moz-landing-system : lando
2019-02-21 04:28:15 +00:00
Masatoshi Kimura e59e3b3e20 Bug 1528651 - Fix some trivial warnings and re-enable warnings-as-errors on Windows in some directories. r=dmajor
--HG--
extra : source : 5ee9efeda9e67f6af0521be85266703763cc4c50
2019-02-19 20:42:11 +09:00
Mike Hommey ef3ad686ee Bug 1512504 - Remove support for MSVC. r=froydnj
Consequently, this removes:
- MOZ_LIBPRIO, which is now always enabled.
- non_msvc_compiler, which is now always true.
- The cl.py wrapper, since it's not used anymore.
- CL_INCLUDES_PREFIX, which was only used for the cl.py wrapper.
- NONASCII, which was only there to ensure CL_INCLUDES_PREFIX still
  worked in non-ASCII cases.

This however keeps a large part of detecting and configuring for MSVC,
because we still do need it for at least headers, libraries, and midl.

Depends on D19614

Differential Revision: https://phabricator.services.mozilla.com/D19615

--HG--
extra : moz-landing-system : lando
2019-02-14 21:45:27 +00:00
Myk Melez 25349d2601 Bug 1518283 - prohibit blank lines at the beginning and end of blocks (eslint padded-blocks) r=mossop,Standard8
Differential Revision: https://phabricator.services.mozilla.com/D17526

--HG--
extra : moz-landing-system : lando
2019-01-30 17:26:25 +00:00
Kris Maglione e930b89c34 Bug 1514594: Part 3 - Change ChromeUtils.import API.
***
Bug 1514594: Part 3a - Change ChromeUtils.import to return an exports object; not pollute global. r=mccr8

This changes the behavior of ChromeUtils.import() to return an exports object,
rather than a module global, in all cases except when `null` is passed as a
second argument, and changes the default behavior not to pollute the global
scope with the module's exports. Thus, the following code written for the old
model:

  ChromeUtils.import("resource://gre/modules/Services.jsm");

is approximately the same as the following, in the new model:

  var {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");

Since the two behaviors are mutually incompatible, this patch will land with a
scripted rewrite to update all existing callers to use the new model rather
than the old.
***
Bug 1514594: Part 3b - Mass rewrite all JS code to use the new ChromeUtils.import API. rs=Gijs

This was done using the followng script:

https://bitbucket.org/kmaglione/m-c-rewrites/src/tip/processors/cu-import-exports.jsm
***
Bug 1514594: Part 3c - Update ESLint plugin for ChromeUtils.import API changes. r=Standard8

Differential Revision: https://phabricator.services.mozilla.com/D16747
***
Bug 1514594: Part 3d - Remove/fix hundreds of duplicate imports from sync tests. r=Gijs

Differential Revision: https://phabricator.services.mozilla.com/D16748
***
Bug 1514594: Part 3e - Remove no-op ChromeUtils.import() calls. r=Gijs

Differential Revision: https://phabricator.services.mozilla.com/D16749
***
Bug 1514594: Part 3f.1 - Cleanup various test corner cases after mass rewrite. r=Gijs
***
Bug 1514594: Part 3f.2 - Cleanup various non-test corner cases after mass rewrite. r=Gijs

Differential Revision: https://phabricator.services.mozilla.com/D16750

--HG--
extra : rebase_source : 359574ee3064c90f33bf36c2ebe3159a24cc8895
extra : histedit_source : b93c8f42808b1599f9122d7842d2c0b3e656a594%2C64a3a4e3359dc889e2ab2b49461bab9e27fc10a7
2019-01-17 10:18:31 -08:00
Ehsan Akhgari e5e885ae31 Bug 1521000 - Part 2: Adjust our clang-format rules to include spaces after the hash for nested preprocessor directives r=sylvestre
# ignore-this-changeset

--HG--
extra : amend_source : 7221c8d15a765df71171099468e7c7faa648f37c
extra : histedit_source : a0cce6015636202bff09e35a13f72e03257a7695
2019-01-18 10:16:18 +01:00
Andrew McCreight 4f8e71a1ca Bug 1519224 - Fix stack frame printing in block_analyzer.py. r=erahm
Also, add a new allocator function.

Differential Revision: https://phabricator.services.mozilla.com/D16241

--HG--
extra : moz-landing-system : lando
2019-01-14 18:41:35 +00:00
Emilio Cobos Álvarez d2ed260822 Bug 1517241 - Rename nsIDocument to mozilla::dom::Document. r=smaug
Summary: Really sorry for the size of the patch. It's mostly automatic
s/nsIDocument/Document/ but I had to fix up in a bunch of places manually to
add the right namespacing and such.

Overall it's not a very interesting patch I think.

nsDocument.cpp turns into Document.cpp, nsIDocument.h into Document.h and
nsIDocumentInlines.h into DocumentInlines.h.

I also changed a bunch of nsCOMPtr usage to RefPtr, but not all of it.

While fixing up some of the bits I also removed some unneeded OwnerDoc() null
checks and such, but I didn't do anything riskier than that.
2019-01-03 17:48:33 +01:00
Mike Hommey a8d4234310 Bug 1511251 - Remove redundant and costly assert. r=njn
The diagnostic assert (so fortunately, it doesn't impact release builds)
as added in bug 1405159, but is costly because it uses the modulus of
the division with a variable integer, which is a slow operation.
However, in arena_run_reg_dalloc, we end up doing the same diagnostic
assert, in a different form: after performing the division in a faster
manner, we assert that the result, multiplied by the diviser, returns
the original number.

Differential Revision: https://phabricator.services.mozilla.com/D13501

--HG--
extra : moz-landing-system : lando
2018-12-05 14:45:52 +00:00
Tooru Fujisawa 7983faeb5d Bug 1511393 - Use c-basic-offset: 2 in Emacs mode line for C/C++ code. r=nbp 2018-12-01 04:52:05 +09:00
Benjamin Bouvier a7f1d173a0 Bug 1511383: Update vim modelines after clang-format; r=sylvestre
- modify line wrap up to 80 chars; (tw=80)
- modify size of tab to 2 chars everywhere; (sts=2, sw=2)

--HG--
extra : rebase_source : 7eedce0311b340c9a5a1265dc42d3121cc0f32a0
extra : amend_source : 9cb4ffdd5005f5c4c14172390dd00b04b2066cd7
2018-11-30 16:39:55 +01:00
Sylvestre Ledru 265e672179 Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
# ignore-this-changeset

--HG--
extra : amend_source : 4d301d3b0b8711c4692392aa76088ba7fd7d1022
2018-11-30 11:46:48 +01:00
Nicholas Nethercote 953ed1dcc1 Bug 1499907 - Add a `jsonEscape` argument to `fixSymbols`. r=erahm
So that dmd.py isn't broken by function names that, after stack fixing, contain
escape-worthy chars such as " and /.

--HG--
extra : rebase_source : 625cef56e4599bbb810273ef04af2b971e777b58
2018-11-21 10:28:00 +11:00
Chris Martin adde9e8556 Bug 1402282 - Change jemalloc to use secure random private arena ids r=glandium
Previously the id for a new arena was just a counter that increased by one
every time. For hardening purposes, we want to make private arenas use a secure
random ID, so an attacker will have a more difficult time finding the memory
they are looking for.

Differential Revision: https://phabricator.services.mozilla.com/D10158

--HG--
extra : moz-landing-system : lando
2018-11-21 01:52:26 +00:00
Mike Hommey c4ea7f7d5a Bug 1507035 - Fix run sizes for size classes >= 16KB on systems with large pages. r=njn
Differential Revision: https://phabricator.services.mozilla.com/D11836

--HG--
extra : moz-landing-system : lando
2018-11-14 06:58:53 +00:00
Mark Banner 50fbf54ef3 Bug 1506559 - Enable ESLint for memory/replace/dmd/test/. r=njn
Differential Revision: https://phabricator.services.mozilla.com/D11619

--HG--
extra : moz-landing-system : lando
2018-11-13 09:07:38 +00:00
arthur.iakab 27754a7d12 Backed out 2 changesets (bug 1402282) for turning multiple browser chrome bugs into permafail
Backed out changeset db7059b57f92 (bug 1402282)
Backed out changeset cea1d44ac776 (bug 1402282)
2018-11-05 17:56:37 +02:00
Chris Martin 3824b0d43e Bug 1402282 - Change jemalloc to use secure random arena ids r=glandium
Previously the id for a new arena was just a counter that increased by one
every time. For hardening purposes, we want to make the new counter a secure
random ID, so an attacker will have a more difficult time finding the memory
they are looking for.

Differential Revision: https://phabricator.services.mozilla.com/D10158

--HG--
extra : moz-landing-system : lando
2018-11-05 00:27:31 +00:00
Chris Martin a1d5bd1909 Bug 1402282 - Clang-format on mozjemalloc r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D10794

--HG--
extra : moz-landing-system : lando
2018-11-05 00:26:00 +00:00
Noemi Erli 06a8cd8e3c Backed out changeset bee1c344cb47 (bug 1491909) for failures in browser/components/extensions/test/xpcshell/test_ext_geckoProfiler_control.js 2018-10-24 04:23:13 +03:00
Denis Palmeiro fc930ad16f Bug 1491909 - Add an AllocPolicy to mozilla::JSONWriter r=jwalden,mstange
JSONWriter currently calls new and delete indirectly through mozilla::MakeUnique to allocate a buffer.  Becuase of this, the methods of this class cannot be invoked within Spidermonkey due to https://searchfox.org/mozilla-central/source/config/check_vanilla_allocations.py#6-14.  Therefore, JSONWriter needs an AllocPolicy template parameter so that the allocation and deallocation routines can be changed to match the JS AllocPolicy when invoked within SpiderMonkey.

Differential Revision: https://phabricator.services.mozilla.com/D7279

--HG--
extra : moz-landing-system : lando
2018-10-23 20:46:31 +00:00
Randell Jesup 0f390bf1a5 Bug 1480430: Modify jemalloc to allow dynamic replacement r=glandium 2018-10-09 22:28:37 -04:00
Eric Rahm c5bb74ff5d Bug 1409739 - Part 1: Accept SmokeDMD when filtering test DMD stacks. r=njn
On some builds we only get 'SmokeDMD' references during testing rather than a full file path. This adds 'SmokeDMD' to the acceptable frame description list.

--HG--
extra : rebase_source : 475166fa6d1f241bf4d67cbdda1aab73000a5c3a
extra : intermediate-source : fcdc1d5eaf1a932992287074d0c91504dd7180d8
extra : source : 1192c15fc9347ccd6169dcb5bea81d7f2399e3fd
2018-10-01 16:38:17 -07:00
Cosmin Sabou 5a8eb92385 Backed out 3 changesets (bug 1409739) for causing Linux x64 ccov & fuzzing bustages. a=backout
Backed out changeset 387f946c7c48 (bug 1409739)
Backed out changeset 617288a6b2d9 (bug 1409739)
Backed out changeset fcdc1d5eaf1a (bug 1409739)
2018-10-03 20:29:42 +03:00
Eric Rahm 703da53d94 Bug 1409739 - Part 1: Accept SmokeDMD when filtering test DMD stacks. r=njn
On some builds we only get 'SmokeDMD' references during testing rather than a full file path. This adds 'SmokeDMD' to the acceptable frame description list.

--HG--
extra : source : 1192c15fc9347ccd6169dcb5bea81d7f2399e3fd
extra : intermediate-source : d39c2dfcc7004a4736436c564de239ba68b20c03
extra : histedit_source : 5a75a20f5b88481c994597da81fdbc29186aba3d%2C3f60f2bfbe54ab3843d4b18d66296cd4aadf4a30
2018-10-01 16:38:17 -07:00
Coroiu Cristina 7f6d72d2a2 Backed out 3 changesets (bug 1409739) for xpcshell failures at memory/replace/dmd/test/test_dmd.js
Backed out changeset dc3c5143ba4e (bug 1409739)
Backed out changeset e37ea5eb932a (bug 1409739)
Backed out changeset d39c2dfcc700 (bug 1409739)
2018-10-03 02:07:19 +03:00
Eric Rahm 6566498f9e Bug 1409739 - Part 1: Accept SmokeDMD when filtering test DMD stacks. r=njn
On some builds we only get 'SmokeDMD' references during testing rather than a full file path. This adds 'SmokeDMD' to the acceptable frame description list.

--HG--
extra : rebase_source : 2b1d2dbf8a3a538533554c6697f0e9ee51ec1bed
extra : source : 1192c15fc9347ccd6169dcb5bea81d7f2399e3fd
2018-10-01 16:38:17 -07:00
Gurzau Raul 4f0690bc0d Backed out 3 changesets (bug 1409739) for failing at /dmd/test/test_dmd.js on a CLOSED TREE
Backed out changeset 39c8abcf9cb2 (bug 1409739)
Backed out changeset c0da83c08b62 (bug 1409739)
Backed out changeset 1192c15fc934 (bug 1409739)
2018-10-02 18:43:32 +03:00
Eric Rahm 0196b4c2ca Bug 1409739 - Part 1: Accept SmokeDMD when filtering test DMD stacks. r=njn
On some builds we only get 'SmokeDMD' references during testing rather than a full file path. This adds 'SmokeDMD' to the acceptable frame description list.

--HG--
extra : rebase_source : 147e62e22248971980d95fe211c86116a98cbdf4
2018-10-01 16:38:17 -07:00
Tom Ritter 934ba40bb8 Bug 1480457-Correct typedef so it matches an earlier typedef r=aklotz
--HG--
extra : amend_source : c6796d3a8bb13939440b390ac9af11054b46dd15
2018-08-30 23:05:59 +03:00
Nicholas Nethercote fe34f19459 Bug 1486690 - Rename nsMemory::Clone() and remove unnecessary checks after it. r=glandium
The 'x' in the new name makes it clearer that it's infallible.

--HG--
extra : rebase_source : 51fd946c482befe8a8ca5bd88ecc967971f455da
2018-08-28 15:59:19 +10:00
Masatoshi Kimura 3d01e517aa Bug 1484184 - Remove now unused _RAISE macro check to deal with MSVC 2017 15.8. r=froydnj
--HG--
extra : source : b38403f36056d301321c128be96ee60d14739859
2018-08-17 01:27:29 +09:00
Narcis Beleuzu 96343e8f1f Backed out 3 changesets (bug 1484184, bug 1484190, bug 1484191) for bustages on test_toolchain_configure.py. CLOSED TREE
Backed out changeset dca5444170e0 (bug 1484190)
Backed out changeset 1ef81d07bc5b (bug 1484184)
Backed out changeset 2a42fd4df1bb (bug 1484191)
2018-08-20 19:49:37 +03:00
Masatoshi Kimura 59a91c2a72 Bug 1484184 - Remove now unused _RAISE macro check to deal with MSVC 2017 15.8. r=froydnj
--HG--
extra : rebase_source : d93dbda28fff9cdbf0f6a908e0c1d59c152665e5
extra : source : b38403f36056d301321c128be96ee60d14739859
2018-08-17 01:27:29 +09:00
Mike Hommey 5f59918688 Bug 1482797 - Don't use MADV_FREE on Linux until we support it properly. r=njn 2018-08-15 21:33:57 +09:00
Nicholas Nethercote b9e071e2e8 Bug 1481998 - Make mozilla::Hash{Map,Set}'s entry storage allocation lazy. r=luke,sfink
Entry storage allocation now occurs on the first lookupForAdd()/put()/putNew().
This removes the need for init() and initialized(), and matches how
PLDHashTable/nsTHashtable work. It also removes the need for init() functions
in a lot of types that are built on top of mozilla::Hash{Map,Set}.

Pros:

- No need for init() calls and subsequent checks.

- No memory allocated for empty tables, which are not that uncommon.

Cons:

- An extra branch in lookup() and lookupForAdd(), but not in put()/putNew(),
  because the existing checkOverloaded() can handle it.

Specifics:

- Construction now can take a length parameter.

- init() is removed. Explicit length-setting, when necessary, now occurs in the
  constructors.

- initialized() is removed.

- capacity() now returns zero when the entry storage is absent.

- lookupForAdd() is no longer `const`, because it can instantiate the storage,
  which requires modifications.

- lookupForAdd() can now return an invalid AddPtr in two cases:

  - old: hashing failure (due to OOM in the hasher)

  - new: OOM while instantiating entry storage

  The existing failure handling paths for the old case work for the new case.

- clear(), finish(), and clearAndShrink() are replaced by clear(), compact(),
  and reserve(). The old compactIfUnderloaded() is also removed.

- Capacity computation code is now in its own functions, bestCapacity() and
  hashShift(). setTableSizeLog2() is removed.

- uint32_t is used throughout for capacities, instead of size_t, for
  consistency with other similar values.

- changeTableSize() now takes a capacity instead of a deltaLog2, and it can now
  handle !mTable.

Measurements:

- Total source code size is reduced by over 900 lines. Also, lots of existing
  lines got shorter (i.e. two checks were reduced to one).

- Executable size barely changed, down by 2 KiB on Linux64. The extra branches
  are compensated for by the lack of init() calls.

- Speed changed negligibly. The instruction count for Bench_Cpp_MozHash
  increased from 2.84 billion to 2.89 billion but any execution time change was
  well below noise.
2018-08-10 18:00:29 +10:00
Mike Hommey f4f54e5aeb Bug 1482330 - Upgrade to Android NDK r17b and API level 16 (JB). r=snorp
We're currently using NDK r15c, which is rather old, and happens to come
with a buggy gold linker. Let's use a more recent NDK, with a fixed
linker.

Unfortunately, we're currently at NDK API level 9, which the newer NDK
doesn't provide for x86 anymore. But that corresponds to Gingerbread
(2.3), which we've long stopped supporting. On the SDK side, we already
dropped support of versions before Jelly Bean, so we can do the same on
the NDK side. That corresponds to API level 16. So let's just use that
as a baseline.

Another change in the newer NDK is that the target-name changed from
i386-linux-android to i686-linux-android, so adjust for that in the
android x86 mozconfigs.
2018-08-11 09:47:41 +09:00
Masatoshi Kimura 3b21b7868b Bug 1090497 - Re-enable warnings as errors on clang-cl. r=froydnj
--HG--
extra : rebase_source : c09366fb93e5b0f72abe1e99d3094e3d96a934fb
extra : intermediate-source : 5950c9d63c3b4fd63a25464a7b50944aaec7079f
extra : source : ca1b9a2bcc4381795f556fea2fb59066567c30f3
2018-07-31 22:10:07 +09:00
Cosmin Sabou de8c2bd891 Backed out changeset 5950c9d63c3b (bug 1090497) for build bustages on several files. CLOSED TREE 2018-08-02 19:59:53 +03:00
Masatoshi Kimura feea19030c Bug 1090497 - Re-enable warnings as errors on clang-cl. r=froydnj
--HG--
extra : rebase_source : a62521fdc66def4e4d5d7bf52e68365a786b5c55
extra : source : ca1b9a2bcc4381795f556fea2fb59066567c30f3
2018-07-31 22:10:07 +09:00
Nicholas Nethercote a4cfd53308 Bug 1478879 - Remove Range/Enum use in DMD. r=mccr8
--HG--
extra : rebase_source : 19428e3d0d1b8676fe55be729b0e75d787086b6c
2018-07-27 12:21:01 +10:00
Nicholas Nethercote 6141e31ef4 Bug 1479954 - Rename Hash{Set,Map}::sizeOf{In,Ex}cludingThis(). r=luke
In PLDHashTable the equivalent functions have a "Shallow" prefix, which makes
it clear that they don't measure things hanging off the table. This patch makes
mozilla::Hash{Set,Map} do likewise.

MozReview-Commit-ID: 3kwCJynhW7d

--HG--
extra : rebase_source : 9c03d11f376a9fd4cfd5cfcdc0c446c00633b210
2018-08-01 09:57:52 +10:00
Nicholas Nethercote 6998f465ed Bug 1477626 - Use mozilla::HashTable instead of JS::HashTable in DMD. r=erahm
Also use mozilla::HashNumber where appropriate.

MozReview-Commit-ID: BTq0XDS5UfQ

--HG--
extra : rebase_source : 28f45a9b27e831e99620a2b575f373003f1301f2
2018-07-26 20:15:58 +10:00
Calixte Denizet 38484d357e Bug 1474254 -- Disable test Jemalloc.JunkPoison for Windows ccov builds.
Summary: GTest is permafailing on Windows because of timeout.

Reviewers: glandium

Reviewed By: glandium

Bug #: 1474254

Differential Revision: https://phabricator.services.mozilla.com/D2043

--HG--
extra : rebase_source : cea68e50f96a1788bf15dc6ca7859e5f698a6209
2018-07-27 22:48:14 +03:00
Brian Hackett 29bb91306b Bug 1465452 Part 5 - Don't record some jemalloc atomics, r=njn.
--HG--
extra : rebase_source : a1dacd30546372e836b69e51f200e4c3e1295930
2018-07-21 14:30:33 +00:00
Brian Hackett f6b8e6f81c Bug 1309552 - Specify buffer size when freeing data in AllocPolicy, r=waldo.
--HG--
extra : rebase_source : f4e2d9f8831cf41c19d592ce252e87161f32250b
2018-07-20 23:58:34 +00:00
Masatoshi Kimura cc03337492 Bug 1476597 - Stop using dynamic exception specification in mozalloc.h. r=froydnj
--HG--
extra : rebase_source : 48047a82e42dc7688fb3ed484d01794ccbd86763
2018-07-18 20:36:25 +09:00
Jacek Caban 505960071d Bug 1471352 - Don't export functions from gcc_throw.h in mingw builds. r=froydnj
MozReview-Commit-ID: D5HQWCN12oI

--HG--
extra : rebase_source : 890d816347162f54204df4dcd5c3297c917da867
2018-06-26 18:55:14 +02:00
Eric Rahm ca834a09a7 Bug 1470268 - Add allocation filter to dmd.py. r=njn
This adds an '--allocation-filter' param that can be used to limit output to
only allocations that include the filter in their stack. For example:
  dmd.py --allocation-filter fontconfig dmd.json.gz
limits its output to just allocations that have an instance of 'fontconfig' in
in one of their stack frames.

--HG--
extra : rebase_source : 9ed34d5c7a6a2b76e96455e66b2e8196686ade16
2018-06-20 13:11:50 -07:00
Jon Coppeard 858a13bce3 Bug 1468767 - Check result of calling vm_copy() r=njn 2018-06-14 14:58:45 -07:00
Sylvestre Ledru 3e84d308c3 Bug 1464869 - Fix flake8/pep8 issue by hand in memory/ r=njn
MozReview-Commit-ID: 8bkhAB4g6rv

--HG--
extra : rebase_source : 623f4ed95d601b47878c910859f3b91e87897011
2018-05-25 23:27:02 -07:00
Sylvestre Ledru 21f28e8329 Bug 1464869 - Run autopep8 on memory/ r=njn
MozReview-Commit-ID: GzFGXZ8WLX5

--HG--
extra : rebase_source : 15b2f8fefaa4ee32a4f655086194202d9e82efb6
2018-05-25 23:16:07 -07:00
Emilio Cobos Álvarez fffb25b74f Bug 1465585: Switch from mozilla::Move to std::move. r=froydnj
This was done automatically replacing:

  s/mozilla::Move/std::move/
  s/ Move(/ std::move(/
  s/(Move(/(std::move(/

Removing the 'using mozilla::Move;' lines.

And then with a few manual fixups, see the bug for the split series..

MozReview-Commit-ID: Jxze3adipUh
2018-06-01 10:45:27 +02:00
Margareta Eliza Balazs 03394c438d Merge inbound to mozilla-central. a=merge 2018-05-24 12:37:58 +03:00
Mike Hommey 7c246fac68 Bug 1460838 - Avoid static initializers in mozjemalloc with MSVC. r=njn
--HG--
extra : rebase_source : dd2106192a90fbade6f89dfa1169c6e9ab3a553b
2018-05-24 11:23:10 +09:00
Andreea Pavel 8469234a9f Bug 1461964 - removed mac 10.6 reference r=njn 2018-05-20 23:08:00 +03:00
Tom Ritter 4e3daa47c1 Bug 1460720 Do not define _aligned_malloc - instead define _aligned_malloc_impl and export _aligned_malloc r=glandium
MozReview-Commit-ID: 3EwAd81Iz7r

--HG--
extra : rebase_source : 899303e4c5db39b24451692f59a9d3bd1f9fd5a2
2018-05-15 11:10:48 -05:00
Tom Ritter 799ec67a16 Bug 1448749 Resolve undefined references to '_imp__mozalloc_abort' in the MinGW build r=glandium
MozReview-Commit-ID: 5enjU5Xp8G9

--HG--
extra : rebase_source : 21e8f5aff8f3d6f26fd9127e0b30099031a587a7
2018-05-16 22:02:05 -05:00
Masatoshi Kimura e98b2c42f0 Bug 1445601 - Stop using LoadLibraryA in replace_malloc. r=glandium
MozReview-Commit-ID: 8EzDtCIlg7F

--HG--
extra : rebase_source : cf909f472c1c0007b2ff759d011435b8b6bc0f37
2018-03-25 13:12:03 +09:00
David Major fa8d998487 Bug 1447795: Add even more UseItOrLoseIt to SmokeDMD.cpp 2018-04-01 09:37:42 -04:00
Tom Ritter 5fda6df793 Bug 1446466 Remove Nightly-only restriction on jemalloc arena implementation r=glandium
MozReview-Commit-ID: CC2cftngmli

--HG--
extra : rebase_source : 5cc5d5b0638b29074cc0e497f4669ebabcf6578a
2018-03-21 20:53:46 -05:00
Tom Ritter 51a8daef9d Bug 1446466 Crash if moz_dispose_arena is called, and comment out all callers r=glandium
Bug 1364359 is to fix a leaked arena. Until that is fixed; it is unsafe to
call moz_dispose_arena more than once.

MozReview-Commit-ID: KIby1RLtrPK

--HG--
extra : rebase_source : 6ea41001e9f0c4d5eb24ee678d6c1c0218991ac3
2018-03-21 20:49:35 -05:00
Margareta Eliza Balazs adebb06ac1 Merge inbound to mozilla-central. a=merge 2018-03-28 00:48:11 +03:00
Carl Corcoran 6766b3d082 Bug 1448546: Adding sized operator delete overloads on Windows builds; r=froydnj
MozReview-Commit-ID: EzhNZEf0suT

--HG--
extra : rebase_source : 695258d519654c9f0f69dc8a1446f28136ae8273
extra : source : 013cfa5c5f358aa02784a8a20bf181d3751d0bbf
2018-03-27 14:42:17 +02:00
Nathan Froyd 3d6d46eaba Bug 1448030 - use SprintfLiteral in fillAbortMessage; r=glandium
The SprintfLiteral checker complains that:

  snprintf(msg, sizeof(msg), ...);

should be using SprintfLiteral instead.  Let's do that.
2018-03-27 10:51:32 -04:00
David Major 0fab6b57fc Bug 1447795 - Add some more UseItOrLoseIt to SmokeDMD.cpp. r=njn 2018-03-21 13:52:00 +02:00
Nathan Froyd b68dfdbc2d Bug 1435407 - declare our wrapped delete definitions with noexcept(true); r=glandium
This behavior matches what gets used in mozalloc.h to define these
wrappers, and is particularly necessary for newer versions of clang to
not complain about our definitions.
2018-03-13 11:10:06 -05:00
Andreea Pavel 6e194b7c24 Merge mozilla-central to mozilla-inbound. a=merge on a CLOSED TREE 2018-03-02 18:24:58 +02:00
Mike Hommey 61d75ea276 Bug 1442468 - Remove workaround for http://code.google.com/p/android/issues/detail?id=23203. r=froydnj
That NDK bug has been fixed since r8c, and we now require something more
recent than that. This effectively reverts the changes from bug 720621
and bug 734832.

--HG--
extra : rebase_source : 9ff76a790ec4135dc0172cfd0f11fc1ecef7df64
2018-03-01 15:15:02 +09:00
Nathan Froyd 9133c59dba Bug 1442325 - remove some dead preprocessor logic; r=glandium
We always compile with C++11 (er, C++14), so there's no need to include
clauses that suggest otherwise.
2018-03-02 07:06:08 -05:00
Florian Quèze c714053d73 Bug 1433175 - scripted patch to replace Components.classes[, Components.interfaces.nsI, Components.utils. and Components.results. with Cc, Ci, Cu and Cr, r=Mossop. 2018-02-28 18:51:33 +01:00
Mike Hommey 5f11951b9b Bug 1441335 - Fix base allocator commit evaluation. r=njn
Base allocator commit stats were added in bug 515556, along other commit
stats, but they have actually been wrong since then: the committed count
is updated with the difference between pbase_next_addr and
base_next_decommitted *after* the latter is set to the former, making
the difference always 0.

--HG--
extra : rebase_source : a2aed523314549a37a61bd4ab300c98f198f9252
2018-02-27 07:39:34 +09:00
Mike Hommey ef4741aa26 Bug 1439470 - Remove some now unnecessary checks. r=njn
Since TreeNode::{Left,Right,Color} is always a valid call to make, we
don't need to check if for nullity before calling those functions.

This effectively kind of reverts some parts of bug 1412722.

--HG--
extra : rebase_source : 3deb316f463b51fdbb3aebc2e57e437018b3a829
2018-02-15 20:25:57 +09:00
Mike Hommey 6442687426 Bug 1439470 - Turn TreeNode(nullptr) into a "virtual" sentinel. r=njn
The code before bug 1412722 benefitted from the sentinel being an actual
node object, and some code paths ended up checking its color (always
black) or getting its right and left node, that always returned to the
sentinel.

When TreeNode currently contains a nullptr, all those lead to a null
deref if the calling code is not doing the right checks, which happens
to be the case in at least some places. Instead of relying on the
callers doing the right thing, make the TreeNode do the right thing when
it contains a nullptr, effectively acting as the sentinel in that case.

We additionally ensure that nothing in the calling code will be trying
to change the color or left/right pointers on the sentinel, which is an
extra safe net compared to the code before bug 1412722.

--HG--
extra : rebase_source : 09ab0bf8682092ef6d9a0a5921be3da787d0d548
2018-02-15 20:20:11 +09:00
Mike Hommey 1c0141e333 Bug 1439470 - Turn TreeNode into a smart pointer-like type. r=njn
This will allow the upcoming changes to add some safety back to the code
after bug 1412722.

--HG--
extra : rebase_source : 5033b8034cabaf5a7fdd578459588d5099402d02
2018-02-15 20:15:00 +09:00
Andreea Pavel e7ca112682 Backed out 3 changesets (bug 1439470) for failing automation.py on a CLOSED TREE
Backed out changeset c43ee00c3e6b (bug 1439470)
Backed out changeset cf9d00862149 (bug 1439470)
Backed out changeset f95559ae3134 (bug 1439470)
2018-02-20 13:39:28 +02:00
Mike Hommey a70ca542aa Bug 1439470 - Remove some now unnecessary checks. r=njn
Since TreeNode::{Left,Right,Color} is always a valid call to make, we
don't need to check if for nullity before calling those functions.

This effectively kind of reverts some parts of bug 1412722.

--HG--
extra : rebase_source : 172f1c042bdbb4d500e1afb4d57774ab76826876
2018-02-15 20:25:57 +09:00
Mike Hommey b4f9300f41 Bug 1439470 - Turn TreeNode(nullptr) into a "virtual" sentinel. r=njn
The code before bug 1412722 benefitted from the sentinel being an actual
node object, and some code paths ended up checking its color (always
black) or getting its right and left node, that always returned to the
sentinel.

When TreeNode currently contains a nullptr, all those lead to a null
deref if the calling code is not doing the right checks, which happens
to be the case in at least some places. Instead of relying on the
callers doing the right thing, make the TreeNode do the right thing when
it contains a nullptr, effectively acting as the sentinel in that case.

We additionally ensure that nothing in the calling code will be trying
to change the color or left/right pointers on the sentinel, which is an
extra safe net compared to the code before bug 1412722.

--HG--
extra : rebase_source : ac61ea259ac49bf76e2f8f6f54dda991498d4664
2018-02-15 20:20:11 +09:00
Mike Hommey 4489841597 Bug 1439470 - Turn TreeNode into a smart pointer-like type. r=njn
This will allow the upcoming changes to add some safety back to the code
after bug 1412722.

--HG--
extra : rebase_source : c906e9b3168fe738cba8a3de3fdf4efee1f0d4df
2018-02-15 20:15:00 +09:00
Mike Hommey c60ee1a610 Bug 1439474 - Make double-free crashes more identifiable. r=njn
- Turn MOZ_DIAGNOSTIC_ASSERTs related to double-frees into
MOZ_RELEASE_ASSERTs with a crash message making them more identifiable
than the asserted condition.
- In huge_dalloc, MOZ_RELEASE_ASSERT early, instead of letting
RedBlackTree::Remove end up crashing because the node is not in the
tree.

--HG--
extra : rebase_source : e051caaf371e88a9db6b5153f58c8a4aa4cde757
2018-02-20 11:39:04 +09:00
Mike Hommey 5c18ecad6b Bug 1438427 - Fix wrong change from bug 1412722 in RedBlackTree::Remove. r=njn
Before bug 1412722, which removed the sentinels, the code looked like:

  if (rbp_r_c->Right()->Left()->IsBlack()) {

At that point in the code, rbp_r_c is the root node of the tree. If
rbp_r_c->Right() was the sentinel, ->Right()->Left() would be the
sentinel too, and the sentinel is black. Which means the condition would
be true.

The code after was:

  if (rbp_r_c->Right() && (!rbp_r_c->Right()->Left() ||
                           rbp_r_c->Right()->Left()->IsBlack())) {

The second half correctly deals with the case of
rbp_r_c->Right()->Left() being the sentinel. But the first half now
makes things different: ->Right() being null would correspond to the
previous case where it was the sentinel, and the test would not return
true in that case when it would have before. When ->Right() is not null,
things are normal again.

The correct check is to make the branch taken when ->Right() is null.

Now, looking under which conditions we may get in that branch wrongly:
- The root node's right link must be empty, which means a very small tree.
- The comparison between the removed key and the root node must indicate
  the key is greater than the value of the root node.
- There's another case where the comparison result (rbp_r_cmp) can be
  eGreater, when it is reassigned under one of the branches under the
  eEqual test, and that branch is only taken when ->Right() on the root
  node was non-null, which was the non-broken case.

So it would seem we can't reach that code when rbp_r_c->Right() is null
anyways, so it /should/ practically make no difference. Better safe than
sorry, though. It's hard to tell anything from crash stats, because
since the templatization in bug 1403444, all crashes fit in one bucket,
when there used to be 5 functions before :(

While here, add a missing include in rb.h.

--HG--
extra : rebase_source : 2ebcb84345ad52059b0c081b9e2e1af1d0bbb7bc
2018-02-15 14:38:52 +09:00
Bobby Holley 3d8a3d0d6d Bug 1436541 - Don't clobber the thread-local arenas when we happen to hit a large allocation. r=glandium
MozReview-Commit-ID: 9i5B76vkNfr
2018-02-07 18:17:48 -08:00
Mike Hommey e483ecaab0 Bug 1424709 - Force disable the OSX system "nano allocator". r=spohl
We're not actually using it, and it messes up with the zone allocator in
mozjemalloc after fork(). See the lengthy analysis in
https://bugzilla.mozilla.org/show_bug.cgi?id=1424709#c34 and following.

--HG--
extra : rebase_source : c58e13b897dde7b32d83c43fbb2a04a0db3a5dc9
2018-01-31 17:18:01 +09:00
Kris Maglione 918ed6c474 Bug 1431533: Part 5a - Auto-rewrite code to use ChromeUtils import methods. r=florian
This was done using the following script:
37e3803c7a/processors/chromeutils-import.jsm

MozReview-Commit-ID: 1Nc3XDu0wGl

--HG--
extra : source : 12fc4dee861c812fd2bd032c63ef17af61800c70
extra : intermediate-source : 34c999fa006bffe8705cf50c54708aa21a962e62
extra : histedit_source : b2be2c5e5d226e6c347312456a6ae339c1e634b0
2018-01-29 15:20:18 -08:00
Cosmin Sabou 9a65a40178 Backed out 3 changesets (bug 1431533) for Android mochitest failures on testEventDispatcher on a CLOSED TREE
Backed out changeset a1eca62826a1 (bug 1431533)
Backed out changeset 34c999fa006b (bug 1431533)
Backed out changeset e2674287e57f (bug 1431533)
2018-01-30 07:17:48 +02:00
Kris Maglione 6476f95b13 Bug 1431533: Part 5a - Auto-rewrite code to use ChromeUtils import methods. r=florian
This was done using the following script:
37e3803c7a/processors/chromeutils-import.jsm

MozReview-Commit-ID: 1Nc3XDu0wGl

--HG--
extra : source : 12fc4dee861c812fd2bd032c63ef17af61800c70
2018-01-29 15:20:18 -08:00
Brindusan Cristian af8879d1eb Backed out 2 changesets (bug 1431533) for ESlint failures on a CLOSED TREE
Backed out changeset 6e56f4c8843e (bug 1431533)
Backed out changeset 12fc4dee861c (bug 1431533)
2018-01-30 02:32:43 +02:00
Kris Maglione c276bb9375 Bug 1431533: Part 5a - Auto-rewrite code to use ChromeUtils import methods. r=florian
This was done using the following script:
37e3803c7a/processors/chromeutils-import.jsm

MozReview-Commit-ID: 1Nc3XDu0wGl

--HG--
extra : rebase_source : c004a023389f1f6bf3d2f3efe93c13d423b23ccd
2018-01-29 15:20:18 -08:00
Marco Castelluccio 871dbb2b23 Bug 1403005 - Don't run memory/replace/logalloc/replay in coverage builds. r=glandium
--HG--
extra : rebase_source : b2f451d764f8efb92082d8b987e74744091bfe4c
2018-01-16 15:45:40 +01:00
Chris Peterson 37efe4d0e6 Bug 1428535 - Add missing override specifiers to overridden virtual functions. r=froydnj
MozReview-Commit-ID: DCPTnyBooIe

--HG--
extra : rebase_source : cfec2d96faeb11656d86d760a34e0a04cacddb13
extra : intermediate-source : 6176724d63788b0fe8caa3f91607c2d93dbaa7ec
extra : source : eebbb0600447f9b64aae3bcd47b4be66c02a51ea
2017-11-05 19:37:28 -08:00
Mike Hommey 3e46ee7dc9 Bug 1417504 - Also wrap Heap{Alloc,ReAlloc,Free} when building without our allocator. r=njn
Bug 1280578 added some wrapping for the Win32 Heap* functions, mainly
for the rust static libraries that use them. Because pointer ownership
might cross the C++/Rust boundary, and because about:memory uses
malloc_usable_size/msize, we need both C++ and Rust to still use the
same heap on builds where our allocator is not enabled.

--HG--
extra : rebase_source : 37a25b376a02ea07c187fb161d2005141e783820
2017-12-19 14:46:23 +09:00