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

1296 Коммитов

Автор SHA1 Сообщение Дата
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