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

1296 Коммитов

Автор SHA1 Сообщение Дата
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
Mike Hommey 2fc6190633 Bug 1423802 - Remove the dummy fallible library. r=nalexander
Bug 1423803 was attempting to remove the fallible library but didn't do
so on Android because of this bug. We can now fully retire it.

--HG--
extra : rebase_source : de38872a08d24768eadfbe81652cfcd6aa7aa041
2017-12-07 12:16:50 +09:00
Gurzau Raul 91d3bc0100 Merge inbound to mozilla-central r=merge a=merge 2017-12-09 00:36:15 +02:00
Ryan VanderMeulen 01e424a4bc Bug 1423649 - Fix compiler errors that happen when building with VS2017 15.5. r=rillian 2017-12-08 10:40:08 -05:00
Sylvestre Ledru 5de63ef061 Bug 1394734 - Replace CONFIG['MSVC'] by CONFIG['CC_TYPE'] r=glandium
MozReview-Commit-ID: 5orfnoude7h

--HG--
extra : rebase_source : 1ed9a6b56e1d27221a07624767a7fb0e6147117f
2017-12-08 13:46:13 +01:00
Sylvestre Ledru 9bfe27d903 Bug 1394734 - Replace CONFIG['GNU_C*'] by CONFIG['CC_TYPE'] r=glandium
MozReview-Commit-ID: 7duJk2gSd4m

--HG--
extra : rebase_source : 7312fe276e561e8c034a5f6749774ae812727f9c
2017-12-07 22:09:15 +01:00
Mike Hommey 154fd9c9ad Bug 1424116 - Change the definition of mozilla::fallible again. r=njn
In bug 1423803, mozilla::fallible was made an "alias" of std::nothrow.
Except C++ doesn't allow compilers to be too smart, and in many cases,
they would actually create data fields to hold a copy of std::nothrow,
even creating a static initializer on non-optimized builds to do so.

By turning it into a reference, we allow compilers to just use
std::nothrow directly, as if it were passed directly, but they can still
create unused data fields. Turning it into a static allows compilers to
skip the data fields altogether.

On a local linux64 build, this saves 242 bytes of .bss.

Note this does change a `lea` (address calculation) into a `mov` (read),
but it shouldn't matter too much.

--HG--
extra : rebase_source : 9c08e8263aef267b8ad5962b0248c7effcb67796
2017-12-08 11:51:59 +09:00
Mike Hommey cd4d96f039 Bug 1424114 - Remove the string.h/cstring include in mozalloc.h. r=njn
While here, change the string.h include to cstring in mozalloc.cpp.

--HG--
extra : rebase_source : d60eac8b5fdb358b43eb32978d5d40a426d50648
2017-12-08 11:47:15 +09:00
Mike Hommey abab5abf88 Bug 1423803 - Turn mozilla::fallible into an alias for std::nothrow. r=njn
The std::nothrow variant of operator new is effectively a fallible
operator new. It is used in third party code.

The duplication with our own fallible operator new is unfortunate, and
we can reduce it by making one an alias of the other.

We keep the fallible library as a dummy on Android because bug 1423802
induces some linking problems.

--HG--
extra : rebase_source : d7b915aaafde40057e87b7ad4bbd82d348e4f12d
2017-12-07 11:32:29 +09:00
Mike Hommey c6b6415a7b Bug 1423512 - Remove unnecessary XPCOM_GLUE define in DMD. r=njn
This was added in bug 1122337 back when the stackwalker was still
in XPCOM, which it isn't anymore, so XPCOM_GLUE is not necessary
anymore.

--HG--
extra : rebase_source : e550671c26e250843d34cb2b83497c861225883f
2017-12-06 09:52:55 +09:00
Dorel Luca ed8dc2034d Merge inbound to mozilla-central r=merge a=merge 2017-12-07 00:01:19 +02:00
Mike Hommey 627d9acca4 Bug 1423461 - Report the right size to the OOM handler for moz_xcalloc. r=njn
--HG--
extra : rebase_source : 536f6504394b14a4968b24fbc719017111a428cf
2017-12-06 16:10:30 +09:00
Mike Hommey 33ca8ff779 Bug 1423461 - Use mozilla/Likely.h in mozalloc.cpp. r=njn
Back when mozalloc.cpp was written, mozilla/Likely.h didn't exist.

--HG--
extra : rebase_source : da3b4c8839a97e3ac2d40da158905ac38c088683
2017-12-06 16:05:08 +09:00