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

180 Коммитов

Автор SHA1 Сообщение Дата
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
Mike Hommey b8f2a1380c Bug 1141731 - Avoid problems caused by the inclusion of mozmemory.h in mozalloc.cpp by including mozmemory_wrap.h instead. r=njn 2015-03-11 16:03:53 +09:00
Wes Kocher b9f1c057ec Backed out changeset ff08cf105def (bug 1141731) for osx bustage 2015-03-10 18:34:28 -07:00
Mike Hommey e5effb28c1 Bug 1141731 - Avoid problems caused by the inclusion of mozmemory.h in mozalloc.cpp by including mozmemory_wrap.h instead. r=njn 2015-03-11 09:52:04 +09:00
Mike Hommey 635ebcf228 Bug 1141660 - Fix bustage from bug 868814 with --disable-replace-malloc. r=njn 2015-03-11 09:52:03 +09:00
Mike Hommey 364038011c Bug 868814 - Fold mozalloc library into mozglue. r=njn
--HG--
rename : memory/mozalloc/moz.build => memory/mozalloc/staticruntime/moz.build
2015-03-10 10:01:52 +09:00
Brian Smith 1bb835dbca Bug 1128413, Part 4: Fix warnings in mozilla-config.h and gcc-stl-wrapper.template.h, r=glandium
--HG--
extra : rebase_source : 7ba4fb8a0bd11648908e2790e86ce3bb4517aeb7
2015-02-02 17:35:19 -08:00
Mike Hommey a35dbaeebf Bug 1126593 - Add a global fallible instance, so that using fallible works directly, everywhere. r=njn
--HG--
rename : memory/mozalloc/fallible.h => memory/fallible/fallible.h
2015-02-02 09:56:13 +09:00
Seth Fowler 26bd4c1cb6 Bug 1121297 (Part 1) - Move VolatileBuffer into libxul. r=glandium
--HG--
rename : memory/mozalloc/VolatileBuffer.h => memory/volatile/VolatileBuffer.h
rename : memory/mozalloc/VolatileBufferAshmem.cpp => memory/volatile/VolatileBufferAshmem.cpp
rename : memory/mozalloc/VolatileBufferFallback.cpp => memory/volatile/VolatileBufferFallback.cpp
rename : memory/mozalloc/VolatileBufferOSX.cpp => memory/volatile/VolatileBufferOSX.cpp
rename : memory/mozalloc/VolatileBufferWindows.cpp => memory/volatile/VolatileBufferWindows.cpp
rename : memory/mozalloc/moz.build => memory/volatile/moz.build
rename : memory/mozalloc/tests/TestVolatileBuffer.cpp => memory/volatile/tests/TestVolatileBuffer.cpp
rename : memory/mozalloc/tests/moz.build => memory/volatile/tests/moz.build
2015-01-16 15:47:22 -08:00
Masatoshi Kimura bf312ad056 Bug 1120062 - Part 1: Remove most Nullptr.h includes. r=waldo 2015-01-11 11:34:52 +09:00
Ehsan Akhgari 4354953b4f Bug 1118486 - Part 1: Use `= delete` instead of MOZ_DELETE directly; r=Waldo
Most of this patch (with the exception of dom/bindings/Codegen.py) was
generated by the following bash script:

#!/bin/bash

function convert() {
echo "Converting $1 to $2..."
find . ! -wholename "*nsprpub*" \
       ! -wholename "*security/nss*" \
       ! -wholename "*/.hg*" \
       ! -wholename "*/.git*" \
       ! -wholename "obj-*" \
         -type f \
      \( -iname "*.cpp" \
         -o -iname "*.h" \
         -o -iname "*.cc" \
         -o -iname "*.idl" \
         -o -iname "*.ipdl" \
         -o -iname "*.ipdlh" \
         -o -iname "*.mm" \) | \
    xargs -n 1 sed -i -e "s/\b$1\b/$2/g"
}

convert MOZ_DELETE '= delete'
2015-01-08 23:19:05 -05:00
Chris Peterson 793516eb34 Bug 1108934 - Fix -Wunused-const-variable warning-as-error in non-unified build of memory/mozalloc. r=glandium 2014-12-08 21:26:27 -08:00
Nicholas Nethercote e4c12e978c Bug 1102525 (part 1) - Add InfallibleAllocPolicy to mozalloc. r=glandium.
--HG--
extra : rebase_source : a79162fb7f73e52c5c8df29c8229efc64c3451e5
2014-12-08 14:45:10 -08:00
Chris Peterson 914cf9e473 Back out part of changeset 2147895c5dc4 (bug 1107814) because of non-unified OS X build breakage on a CLOSED TREE. a=philor 2014-12-08 21:42:58 -08:00
Chris Peterson e424225899 Bug 1107814 - Part 2: Mark some directories as FAIL_ON_WARNINGS conditionally for some compilers. r=gps 2014-12-04 01:11:14 -08:00
Mike Hommey 47c853314f Bug 1077148 part 4 - Add and use new moz.build templates for Gecko programs and libraries. r=gps
There are, sadly, many combinations of linkage in use throughout the tree.
The main differentiator, though, is between program/libraries related to
Gecko or not. Kind of. Some need mozglue, some don't. Some need dependent
linkage, some standalone.

Anyways, these new templates remove the need to manually define the
right dependencies against xpcomglue, nspr, mozalloc and mozglue
in most cases.

Places that build programs and were resetting MOZ_GLUE_PROGRAM_LDFLAGS
or that build libraries and were resetting MOZ_GLUE_LDFLAGS can now
just not use those Gecko-specific templates.
2014-10-30 13:06:12 +09:00
Mike Hommey b77d0f1d19 Bug 1077366 - Remove most symbol wrapping from Android builds. r=nfroyd
Since essentially everything is linked to libmozglue and libmozglue takes
precedence in symbol resolution in our dynamic linker, there is no need
to wrap most symbols. PR_GetEnv/PR_SetEnv still needs wrapping because
there's no other way to actually wrap the calls from NSPR itself and NSS,
as well as the symbols wrapped because our dynamic linker can't find them
in system libraries on some devices because they're weak.
2014-10-14 07:17:13 +09:00
Jim Chen 52a3b4cf21 Bug 1067018 - Always specify throw() for nothrow placement new/delete; r=glandium 2014-09-26 15:45:45 -04:00
Jim Chen 2c4251ec3e Bug 1066760 - Use more detailed abort message on Android; r=snorp 2014-09-24 14:12:54 -04:00