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

198 Коммитов

Автор SHA1 Сообщение Дата
Nathan Froyd f51359bd19 Bug 1325632 - part 5 - ensure that we compile with -fno-sized-deallocation when possible; r=chmanchester
We currently turn off the C++14 sized-deallocation facility on MSVC, and
we'd like to ensure we do the same thing for clang and gcc.  To do so,
we add new functionality to moz.configure for checking and adding
compilation flags, similar to the facility for checking and adding
warning flags.  The newly added facility is then used to add
-fno-sized-deallocation to the compilation flags, when the option is
supported.

Once we do this, we can't define the sized deallocation functions in
mozalloc.h; the compiler will complain that we are using
-fno-sized-deallocation, yet defining these special functions that we'll
never use.  These functions were added for MinGW, where we needed to
compile with C++14 ahead of other platforms to be compatible with MSVC
headers.  But they're no longer necessary, though they would be if we
removed -fno-sized-deallocation; the compiler will complain if we do
that and we'll add them back at that point.
2017-11-15 14:53:16 -04:00
Sylvestre Ledru d60d69e2cb Bug 1411001 - Remove the +x permissions on cpp & h files r=froydnj
MozReview-Commit-ID: DjDkL20wRg0

--HG--
extra : rebase_source : a343d83d1f4e97e4ba56d0f57fec93079df0b5ea
2017-10-23 20:59:55 +02:00
Tom Ritter fdab21a20a Bug 1406197 Declare sized deallocators (that ignore the size) to correct a MinGW warning r=glandium
MozReview-Commit-ID: Dl4uu6evlbs

--HG--
extra : rebase_source : f9b04123b1f09a49155f0bb24704f9e11818ff5a
2017-10-10 13:16:10 -05:00
Nathan Froyd f8fda5a9b5 Bug 1396889 - don't warn about infinite recursion in mozalloc_abort; r=glandium
mozalloc_abort is not marked as a noreturn function on ARM, so clang
complains when abort calls mozalloc_abort, which calls MOZ_CRASH, which
calls abort().  We know this is OK, so just disable the warning.
2017-09-14 09:52:50 -04:00
Chris Manchester fab07bc443 Bug 1386876 - Replace all uses of NO_VISIBILITY_FLAGS with a template and remove NO_VISIBILITY_FLAGS. r=glandium
MozReview-Commit-ID: 194U1WMCAM0

--HG--
extra : rebase_source : 365b68b0a1772d238ae9b84966e53dcd1197fd85
2017-05-01 18:12:35 -07:00
Chris Manchester c0a229d4c3 Bug 1386876 - Replace all uses of DISABLE_STL_WRAPPING with a template, remove DISABLE_STL_WRAPPING. r=glandium
MozReview-Commit-ID: FMEtb5PY7iP

--HG--
extra : rebase_source : 3cdee7528846462c758e623d6bcd2e6e17dbabff
2017-09-11 11:33:26 -07:00
Nicholas Nethercote c419d5fa48 Bug 1389305 (attempt 2) - Add jemalloc_ptr_info() and moz_malloc_enclosing_size_of(). r=glandium.
--HG--
extra : rebase_source : 93a6cfcc916fb239581c2892f24b24c6fc65ac71
2017-09-01 11:52:23 +10:00
Sebastian Hengst 4310ea4600 Backed out changeset f232b5b1a0c7 (bug 1389305) for frequently failing GTest Jemalloc.PtrInfo on Linux opt. r=backout 2017-08-31 13:52:48 +02:00
Nicholas Nethercote 365285b831 Bug 1389305 - Add jemalloc_ptr_info() and moz_malloc_enclosing_size_of(). r=glandium.
jemalloc_ptr_info() gives info about any pointer, such as whether it's within a
live or free allocation, and if so, info about that allocation. It's useful for
debugging.

moz_malloc_enclosing_size_of() uses jemalloc_ptr_info() to measure the size of
an allocation from an interior pointer. It's useful for memory reporting,
especially for Rust code.

--HG--
extra : rebase_source : caa19cccf8c2d1f79cf004fe6a408775de5a7b22
2017-08-24 19:37:27 +10:00
Botond Ballo b93629ee1d Bug 1383919 - Use |noexcept| instead of an exception-specification in mozalloc.h. r=glandium
MozReview-Commit-ID: DwrE8cmZOQN

--HG--
extra : rebase_source : e45f35dd009a3a8a94f50afc55177976c532f16a
2017-07-24 19:19:07 -04:00
Petr Sumbera a393f2a6cf Bug 1375467 - Redefining abort() in C++ requires extern "C". r=glandium 2017-06-22 05:09:05 -07:00
Jeff Gilbert 58ae26fbc7 Bug 1376057 - Replace MSVC wrappers with std::exception::_Set_raise_handler. - r=froydnj
MozReview-Commit-ID: MG5c4bzDlI
2017-06-27 11:51:34 -07:00
Mike Hommey 0400284f88 Bug 1365194 - Make `extern "C"` part of MOZ_MEMORY_API and MOZ_JEMALLOC_API. r=njn
This avoids many additions of `extern "C"` in C++ code and will avoid
having to do the same to mozjemalloc once built as C++.

--HG--
extra : rebase_source : af55696262f40a9dd16a19c29edcb9bb307d4957
2017-05-16 18:46:02 +09:00
Carsten "Tomcat" Book 9c3f61e278 Backed out changeset b56224bf370d (bug 1365194) 2017-05-17 11:43:26 +02:00
Mike Hommey 2bd75405bc Bug 1365194 - Make `extern "C"` part of MOZ_MEMORY_API and MOZ_JEMALLOC_API. r=njn
This avoids many additions of `extern "C"` in C++ code and will avoid
having to do the same to mozjemalloc once built as C++.

--HG--
extra : rebase_source : af55696262f40a9dd16a19c29edcb9bb307d4957
2017-05-16 18:46:02 +09:00
Tom Ritter f8036e08d5 Bug 1332747 Change MOZ_ALWAYS_INLINE to MOZ_ALWAYS_INLINE_EVEN_DEBUG to fix MinGW Debug build r=froydnj
MozReview-Commit-ID: 7CkreJM1mHr

--HG--
extra : rebase_source : 8dc51c9c1b0e10bd7b40f3c6f65b2495dfe22cb1
2017-04-11 12:53:58 -05:00
Bevis Tseng 2a318e8c71 Bug 1332491 - Delete SelectorCacheKey synchronously. r=bz
1. The current asynchronous behavior is pointless, because we still remove the
   hashtable entry synchronously, which deletes the value, and it's the value
   we're using.
2. Trying to asynchronously delete the value is difficult, and not currently
   needed because we can't get a memory-pressure notification while we're using
   the value, and hence can't expire it from the expiration tracker.
   Note: we can't get this memory-pressure notification because the stage 2 of
   mozalloc_handle_oom() to reclaim memory when OOM is not implemented yet.
2017-03-13 14:37:19 +08:00
Dimitry Andric 8b0557b033 Bug 1329520 - Fix "memory/mozalloc/throw_gcc.h:35:1: note: declaration missing '[[noreturn]]' (libc++ 4.0)" r=nfroyd 2017-01-27 13:55:00 +01:00
Wes Kocher 50954c6f31 Merge m-c to autoland, a=merge 2016-08-25 17:15:05 -07:00
Emanuel Hoogeveen 8210833803 Bug 1294732 - Back out all of bug 1271165 as it has served its purpose. r=glandium 2016-08-23 08:45:00 -04:00
Andrew McCreight 5772f60634 Bug 1295695 - Add maybe_pod_* methods to InfallibleAllocPolicy. r=glandium
Bug 1207519 added maybe_pod_* methods to the allocation policy
classes, but did not add them to InfallibleAllocPolicy.

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

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

MozReview-Commit-ID: 97D66Z4oLfl

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

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

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

MozReview-Commit-ID: 1g99BXLceQI

--HG--
extra : rebase_source : 927d842588c1f85a50a7a1c50a5546d5f688555f
2016-08-16 10:56:14 -07:00
Emanuel Hoogeveen 581ecef4dd Bug 1271165 - Part 6: Change the new functions to MFBT_API to export them on OSX. r=jandem
--HG--
extra : rebase_source : cc3d6cd7cec9c822904364ace811d2c0dff98eff
2016-08-16 07:12:00 -04:00
Emanuel Hoogeveen 57b1d1e8f2 Bug 1271165 - Part 2: Hook the new functions up and provide dummy implementations where needed. r=ehoogeveen 2016-08-12 07:37:00 -04:00
Tom Tromey 5538d692d3 Bug 1286877 - do not set c-basic-offset for python-mode; r=gps
This removes the unnecessary setting of c-basic-offset from all
python-mode files.

This was automatically generated using

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

... on the affected files.

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

MozReview-Commit-ID: 2pPf3DEiZqx

--HG--
extra : rebase_source : 0a7dcac80b924174a2c429b093791148ea6ac204
2016-07-14 10:16:42 -06:00
Mike Hommey 63e7e7ede4 Bug 1280578 - Wrap HeapAlloc, HeapFree and HeapReAlloc on Windows. r=njn
The Win32 has non-malloc based heap allocation functions. They are not
widely used in the Gecko code base, but there are a few places that do
use them. They could be replaced with uses of malloc/free/realloc or
new/delete, but there is now an entirely separate problem that
requires wrapping those functions: the Rust static libraries are using
those functions to allocate memory.
2016-07-20 14:04:40 +09:00
Bill McCloskey 308608ab39 Bug 1262671 - Introduce MFBT BufferList class (r=froydnj) 2016-05-27 09:57:40 -07:00
Mike Hommey 8855262939 Bug 1269171 - Change how mozalloc.h is hooked in STL wrappers. r=froydnj
Since the introduction of the STL wrappers, they have included
mozalloc.h, and multiple times, we've hit header reentrancy problems,
and worked around them as best as we could.

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

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

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

So all in all, it doesn't matter that mozalloc.h is included before the
wrapped STL headers. What matters is that it's included when STL headers
are included. So arrange things such that mozalloc.h is included after
the first wrapped STL header is fully preprocessed (and all its includes
have been included).
2016-05-22 08:32:40 +09:00
Chris Peterson 8a9e2d2bd4 Bug 1272513 - Part 2: Remove redundant -Wshadow CXXFLAGS from moz.build files. r=glandium 2016-05-14 00:54:55 -07:00
Jan Beich 6d9051edd6 Bug 1259537 - Unbreak libc++ build after bug 1245076. r=glandium
MozReview-Commit-ID: 31otXvuDu4A

--HG--
extra : rebase_source : 048a81a540154b672a9249482124d396336acbc4
2016-05-01 09:32:10 +00:00
Nicholas Nethercote 2511b2c327 Bug 1267550 (part 2) - Rename MOZ_WARN_UNUSED_RESULT as MOZ_MUST_USE. r=froydnj.
It's an annotation that is used a lot, and should be used even more, so a
shorter name is better.

MozReview-Commit-ID: 1VS4Dney4WX

--HG--
extra : rebase_source : b26919c1b0fcb32e5339adeef5be5becae6032cf
2016-04-27 14:16:50 +10:00
Lee Salzman 5a00a76a1f Bug 1248416 - add symbols for bad_function_call exception for C++ runtimes. r=nfroyd 2016-02-24 20:00:10 -05:00
Mike Hommey 762aba02cd Bug 1221453 - Use ObjDirPaths for GENERATED_INCLUDES and merge with LOCAL_INCLUDES. r=gps 2015-11-06 09:59:21 +09:00
Chris Peterson 71920a9550 Bug 1207030 - Enable -Wshadow flag in more directories that have no -Wshadow warnings. r=glandium 2015-09-22 21:39:03 -07:00
Nicholas Nethercote cfcd8fbc5f Bug 1203476 - Fix an Android-only warning in mozalloc_abort.cpp. r=glandium.
And remove the corresponding and now-unnecessary ALLOW_COMPILER_WARNINGS=True.
2015-09-10 16:20:19 -07:00
Nicholas Nethercote f44287005f Bug 1198334 (part 1) - Replace the opt-in FAIL_ON_WARNINGS with the opt-out ALLOW_COMPILER_WARNINGS. r=glandium.
The patch removes 455 occurrences of FAIL_ON_WARNINGS from moz.build files, and
adds 78 instances of ALLOW_COMPILER_WARNINGS. About half of those 78 are in
code we control and which should be removable with a little effort.

--HG--
extra : rebase_source : 82e3387abfbd5f1471e953961d301d3d97ed2973
2015-08-27 20:44:53 -07:00
Mike Hommey b6607b1ad5 Bug 1189967 - Avoid conflicting declarations for our raise wrappers on Windows. r=nfroyd 2015-08-23 22:22:26 +09:00
Mike Hommey dea9486c28 Bug 1120793 - Remove obsolete _Throw wrapping. r=froydnj 2015-08-21 14:28:41 +09:00
Birunthan Mohanathas a8939590de Bug 1182996 - Fix and add missing namespace comments. rs=ehsan
The bulk of this commit was generated by running:

  run-clang-tidy.py \
    -checks='-*,llvm-namespace-comment' \
    -header-filter=^/.../mozilla-central/.* \
    -fix
2015-07-13 08:25:42 -07:00
Ted Mielczarek 7958285841 bug 1171122 - Swap some XP_MACOSX for XP_DARWIN in mozalloc. r=glandium
--HG--
extra : commitid : 7pqjkOrdp47
extra : rebase_source : 08da613870a54423b33cecc615f46324db63f384
2015-03-27 22:53:02 -04:00
Christian Holler 3091dad435 Bug 1170177 - Disable our own abort() method with MOZ_ASAN. r=froydnj 2015-06-02 23:25:01 +02:00
Mike Hommey c917606f95 Bug 1043692 - Move DIST_INSTALL to moz.build. r=gps 2015-05-12 07:55:22 +09:00
Jim Blandy 1121ad9a09 Bug 1145051: Don't include xpcom-config.h from mozalloc.h; it's unused. r=glandium
--HG--
extra : rebase_source : 7218f1f16db1d6c439583022c4dc73e4da8e4312
2015-03-19 01:03:05 -07:00
Jim Blandy 6afdd6c96b Bug 1145051: Use MOZ_WARN_UNUSED_RESULT instead of NS_WARN_UNUSED_RESULT. r=glandium
--HG--
extra : rebase_source : d210822225d307f3e3685cb5f95b461c48c0be7e
2015-03-19 00:46:40 -07:00
Jim Blandy a778e9f970 Bug 1145051: Replace uses of NS_ATTR_MALLOC with new MOZ_ALLOCATOR from mfbt/Attributes.h. r=glandium
--HG--
extra : rebase_source : 294215445f084687ed7fa51b88e7a22e586447a2
2015-03-18 23:56:08 -07:00
ISHIKAWA, Chiaki 5933b89b08 Bug 1147248 - GCC 4.9 needs this patch to use address sanitizer. r=glandium
--HG--
extra : rebase_source : 08c553d5b5ff76abd81b070ccd6e2f058a2c4e4b
2015-04-10 15:05:00 +02:00
Mike Hommey 26b3c4f285 Bug 1138293 - Remove moz_malloc/moz_free/moz_realloc/moz_calloc. r=njn
We need to use _impl variants within mozalloc.h when they are defined because
of how mozglue.dll is linked on Windows, where using malloc/free would use
the symbols from the MSVCRT instead of ours.
2015-03-31 12:32:49 +09:00
Mike Hommey 7fef46c799 Bug 1142434 - Remove moz_memalign/moz_valloc, nothing uses them. r=njn 2015-03-31 12:26:45 +09:00
Mike Hommey d0806aa5f6 Bug 1142434 - Remove moz_strdup/moz_strndup, nothing uses them. r=njn 2015-03-31 12:26:45 +09:00
Mike Hommey 5b1c46a9cb Followup for bug 868814 - replace non-obvious #if with simpler alternative. rs=njn 2015-03-17 10:04:20 +09:00