Botond Ballo
2c2d3ded79
Bug 1371771 - Add a MOZ_DEFINE_ENUM macro and variants to MFBT. r=froydnj
...
The macro simultaneously declares an enumeration and a count of its
enumerators.
A few variants of the macro are also provided to handle things like
enum classes, underlying types, and enumerations declared at class
scope.
MozReview-Commit-ID: 3z6yHnfXbLj
--HG--
extra : rebase_source : 92c333693e4bbf85b89cd3d7ac5b31f4b5434367
2017-06-30 19:58:11 -04:00
Chris Peterson
0a377e9314
Bug 1373525 - mfbt: Use unused GetPrev() member function in DoublyLinkedList test. r=froydnj
...
mfbt/tests/TestDoublyLinkedList.cpp:138:24 [-Wunused-member-function] unused member function 'GetPrev'
MozReview-Commit-ID: HQuTw0vXRKV
--HG--
extra : source : 0db3bd8a40d67a81b2f224dc9e63012cb832d0b9
extra : intermediate-source : 948c43ff15b4ca1a3db335544494562ec28e67cc
2017-06-11 14:39:42 -07:00
Petr Sumbera
80944c40d8
Bug 1158445 - posix_madvise() should be used instead of madvise on Solaris. r=froydnj, r=jandem
2017-06-09 00:59:32 -07:00
Henri Sivonen
854d241f4f
Bug 1359874 - Make Span::Elements() always return a non-null pointer. r=froydnj.
...
MozReview-Commit-ID: AGvNlHmonpi
2017-06-13 13:22:34 +03:00
Gerald Squelart
f5f8abf86a
Bug 1338389 - Tests for Variant's detail::Nth and detail::SelectVariantType - r=froydnj
...
MozReview-Commit-ID: 4QXdctmhNze
--HG--
extra : rebase_source : ddbdf8c79f49ebb02c9e68dca0be4a6ee9ad11f4
2017-06-06 16:59:00 +12:00
Gerald Squelart
a7c6eed190
Bug 1338389 - VariantType<T> and VariantIndex<N> permit unambiguous and variadic Variant construction - r=froydnj
...
MozReview-Commit-ID: 3rDya9ZBG6Y
--HG--
extra : rebase_source : d59375a7c805d6d470f5074669f3db5a609eb518
2017-05-08 11:26:07 +12:00
Gerald Squelart
78bc93af40
Bug 1338389 - Allow repeated Variant types, but prevent is/as/extract<T> for them - r=froydnj
...
MozReview-Commit-ID: 1yEUuGsht8k
--HG--
extra : rebase_source : fed56f264821e87cc474e6686e6dc203c147ac9b
2017-05-10 15:49:38 +12:00
Gerald Squelart
6015fbb5ac
Bug 1338389 - Index-based Variant::is<N>, as<N>, and extract<N> - r=froydnj
...
MozReview-Commit-ID: C5iga0Eb1tH
--HG--
extra : rebase_source : d88cf614318cc8544d7ab52315e015a7ca4e5efd
2017-05-08 11:09:21 +12:00
Mike Hommey
38a6de0fe3
Bug 1369622 - Fix MOZ_FOR_EACH with an empty list. r=froydnj
...
I'm not sure how I tested MOZ_FOR_EACH in bug 1368932, but it turns out
it doesn't work with an empty list, despite
MOZ_PASTE_PREFIX_AND_ARG_COUNT now supporting 0 arguments.
Macros can be tricky, and it ends up being easier to make things work
cross-compiler with a separate macro that does the counting, and
(re)building MOZ_PASTE_PREFIX_AND_ARG_COUNT on top of that. Then
MOZ_FOR_EACH ends up working as expected with an empty list.
So this adds a MOZ_ARG_COUNT macro that counts the number of variadic
arguments it's given, and derives MOZ_PASTE_PREFIX_AND_ARG_COUNT from
it.
And this adds a testcase validating that MOZ_FOR_EACH works properly
with an empty list as a result.
--HG--
extra : rebase_source : 309371d87bd1561fbd2153f44fc1256185045d23
2017-06-02 14:53:54 +09:00
Mike Hommey
c1becb4a54
Bug 1368932 - Allow MOZ_PASTE_PREFIX_AND_ARG_COUNT to work with 0 arguments. r=froydnj
...
At the same time, remove the MOZ_STATIC_ASSERT_VALID_ARG_COUNT, which
doesn't actually work for more than 50 arguments(*), and which is now not
useful to detect 0 arguments.
(*) the build fails, but not directly thanks to the static_assert it
expands to.
--HG--
extra : rebase_source : 8f0fe7b352c89b5a3ec87f42ef5464c370c362ef
2017-05-25 15:47:21 +09:00
Bas Schouten
5a025e5c1f
Bug 1331718 - Part 2: Add unit tests for SmallPointerArray. r=froydnj
...
MozReview-Commit-ID: 7xdQfv7Dpph
2017-05-10 05:07:38 +02:00
Carsten "Tomcat" Book
157a9fcde2
Backed out changeset 4527bd35cc4e (bug 1331718)
2017-05-10 12:09:06 +02:00
Bas Schouten
e8f8394b4e
Bug 1331718 - Part 2: Add unit tests for SmallPointerArray. r=froydnj
...
MozReview-Commit-ID: 7xdQfv7Dpph
2017-05-10 05:07:38 +02:00
Olli Pettay
a991315918
Bug 1358761 - dummy handling for return values in test, r=bustage
2017-05-05 10:43:37 +03:00
Olli Pettay
0096f25b51
Bug 1358761 - replace PurpleBlock with SegmentedVector to reduce indirect memory accesses when calling suspect, r=mccr8,nfroyd
...
--HG--
extra : rebase_source : e74be6bfb9efbba9361d2ce3c22518379a332200
2017-05-05 00:49:22 +03:00
Terrence Cole
4cd9f1b817
Bug 1277725 - Implement a list class that is both usable and efficient. r=waldo
...
MozReview-Commit-ID: JnhnomQwSja
2016-06-02 09:18:40 -07:00
Henri Sivonen
4064812605
Bug 1353324 - Add const char16_t variant of MakeCStringSpan() and rename both to MakeStringSpan(). r=froydnj.
...
MozReview-Commit-ID: E6LEZpe5H4w
--HG--
extra : rebase_source : dd6fe66be289e94751ecdf34113d79a091c9c8f8
2017-04-04 14:04:14 +03:00
Henri Sivonen
c514501f1a
Bug 1295611 - Add mozilla::Span. r=froydnj,gerv.
...
MozReview-Commit-ID: HGNDClVctbE
2017-03-31 13:32:18 +03:00
Benjamin Bouvier
1397cfaed9
Bug 1352073: Follow-up: don't use reserved() in opt builds; r=bustage
...
Also fix style to make it match local style.
MozReview-Commit-ID: D2HTik6HwxJ
--HG--
extra : rebase_source : 73d5a6d63597764d904f2d254ced08192871fdc0
2017-03-31 11:01:35 +02:00
Benjamin Bouvier
0eeedcfb9c
Bug 1352073: Fix off-by-one in Vector::insert; r=luke
...
MozReview-Commit-ID: HY0DYSAbi6M
--HG--
extra : rebase_source : 15aaf8576c6c78e1dd097685947507445808ee0c
extra : histedit_source : 9ece90f05a7666784a381be085a82231aef5ef29
2017-03-30 16:20:30 +02:00
Tom Ritter
da72de1e2e
Bug 1349957 Change reference (in disabled code) to new/correct member r=froydnj
...
MozReview-Commit-ID: IwA2Kro40e2
--HG--
extra : rebase_source : 0bd5f3e85ba36d068f0b23984a1faa5dcd4ccd78
2017-03-23 10:27:25 -05:00
Nicolas B. Pierron
dccaffb213
Bug 1325073 - Rename mozilla::MakeGenericErrorResult to mozilla::Err. r=Waldo
2017-03-08 13:33:07 +00:00
Xidorn Quan
b7ebe87cdc
Bug 1345074 - Add MOZ_FOR_EACH_SEPARATED which adds separator between items. r=Waldo
...
MozReview-Commit-ID: IWqs17MLhHD
--HG--
extra : rebase_source : adc004b185501c9fe8109589fb671cd5a6551002
2017-03-07 22:28:49 +11:00
Jeff Walden
fceda02d9b
Bug 1287006 - Use |alignas(T) unsigned char mStorage[sizeof(T)]| instead of AlignedStorage2 inside Maybe. r=froydnj
...
--HG--
extra : rebase_source : 59e8039481b332decacd1acc7cf1cb73ec8b78cf
2017-01-30 15:56:04 -08:00
Jeff Walden
8529eb5317
Bug 1338374 - Shrink Vector from (usually) four pointers in size to three when no inline storage is used. r=froydnj
...
--HG--
extra : rebase_source : bc2c7f706305d04954162720b011029c8095229f
2017-01-30 15:56:05 -08:00
Nicolas B. Pierron
06bb70ebad
Bug 1318677 part 3 - mozilla::Result: Add a new packing strategy to pack small enumerated values in a single word. r=Waldo
2017-02-07 18:57:43 +00:00
Jonathan Watt
33a6ca0109
Bug 1335780, part 2 - Tests for Maybe<const Type>. r=froydnj
2017-01-03 08:53:05 +00:00
John Paul Adrian Glaubitz
ba58645c87
Bug 1329194 - mfbt:tests: Define RETURN_INSTR for SH in TestPoisonArea. r=glandium
2017-01-20 09:12:22 +09:00
David Major
bbf01a2d5f
Bug 1329236: Remove the DECLTYPE(expr) workaround in TestMaybe.cpp. r=ehsan
...
MozReview-Commit-ID: 5n5iRdJKn7M
--HG--
extra : rebase_source : 181165142b1f39c59c404b0b692383dd63a423b9
2017-01-06 12:53:20 -06:00
Nathan Froyd
f6a73ed989
Bug 1315274 - rename mozilla::MakeRange to mozilla::IntegerRange; r=Waldo
...
MakeRange is just way too generic for this sort of thing.
2017-01-06 09:22:53 -05:00
Xidorn Quan
b4ceaa3474
Bug 1325351 part 3 - Make Maybe accept value from different Maybe type when the inner type is convertible. r=froydnj
...
MozReview-Commit-ID: 2kYTncYh1Or
--HG--
extra : rebase_source : f3263ce10f3afae6e8ac734296dbb0e641c55c99
2016-12-23 11:49:33 +11:00
Sebastian Hengst
6c5fadc6f5
Backed out changeset 45f0755ff471 (bug 1325351)
2016-12-27 10:39:45 +01:00
Xidorn Quan
3cead98957
Bug 1325351 part 3 - Make Maybe accept value from different Maybe type when the inner type is convertible. r=froydnj
...
MozReview-Commit-ID: 2kYTncYh1Or
--HG--
extra : rebase_source : 2d15fb3c252f1c0505d739d9540079ceb9296b39
2016-12-23 11:49:33 +11:00
Nick Fitzgerald
a19333ea56
Bug 1324829 - Add the `mozilla::Result::andThen` method; r=froydnj
2016-12-21 13:05:56 -08:00
Nick Fitzgerald
f40c749727
Bug 1324828 - Add the `mozilla::Result::map` method; r=froydnj
2016-12-21 13:05:56 -08:00
Nathan Froyd
2ebbd09068
Bug 1320752 - remove mozilla/Function.h; r=gerald
...
We have std::function available now, which is likely to be somewhat more
efficient.
2016-11-28 11:03:53 -05:00
Jan de Mooij
2975885bae
Bug 1283562 - Add mozilla::Result<V, E> for fallible return values. r=jwalden
2016-11-21 12:52:03 +01:00
Ting-Yu Lin
d60ec2b4d6
Bug 1315624 - Delete operator&& and operator|| for CastableTypedEnumResult. r=froydnj
...
Defining these two overloading functions destroys short-circuit evaluation.
MozReview-Commit-ID: Ac7zPtAGOiE
--HG--
extra : rebase_source : 4b3906b5162c1214b9814166f7d0d7de9cb0a7f9
2016-11-07 15:00:16 +08:00
Nathan Froyd
9238cab1b1
Bug 1315352 - enable Range<T> -> Range<const T> conversion; r=Waldo
...
Since |T*| converts into |const T*|, if we want to rewrite code such as:
void DoSomething(const T*, size_t);
void DoSomethingElse(T* x, size_t len)
{
...
DoSomething(x, len);
}
to use ranges:
void DoSomething(Range<const T>);
void DoSomethingElse(Range<T> x)
{
...
DoSomething(x);
}
we need to ensure this conversion works. gsl::span<T> already provides
something like this as well.
2016-11-07 19:30:34 -04:00
Bill McCloskey
4c8471eb15
Bug 1310547 - Add removeAndGetNext/Previous methods to LinkedList (r=froydnj)
2016-10-30 22:04:01 -07:00
Bill McCloskey
c0d229e060
Bug 1310547 - Allow LinkedList to hold RefPtr elements (r=froydnj)
2016-10-30 22:04:00 -07:00
Sebastian Hengst
bff4ebdec8
Backed out changeset c41a71b1c24e (bug 1310547) for failing splitText-normalize.html in reftests on Windows 7 VM debug. r=backout on a CLOSED TREE
2016-10-29 13:48:56 +02:00
Sebastian Hengst
b063eb49cb
Backed out changeset 721e3171510d (bug 1310547)
2016-10-29 13:45:28 +02:00
Bill McCloskey
5a6e5a85cf
Bug 1310547 - Add removeAndGetNext/Previous methods to LinkedList (r=froydnj)
2016-10-28 20:11:03 -07:00
Bill McCloskey
89ca6e236f
Bug 1310547 - Allow LinkedList to hold RefPtr elements (r=froydnj)
2016-10-28 20:10:37 -07:00
Johannes Schulte
b7ccc22970
Bug 1312620
- Add IsPositiveZero function to mfbt and use it to replace MPhi by MNaNToZero iff c is +0.0. r=nbp, r=waldo
...
--HG--
extra : rebase_source : 7adefc3370c081e17b5e0b090a008e0de0507bb9
2016-10-26 17:47:42 +02:00
James Cheng
3bf8f58291
Bug 1309466 - Add Test for the init value by constructor. r=froydnj
...
MozReview-Commit-ID: 9BguTY6dlRD
--HG--
extra : rebase_source : 8aef83263e8a406f6a4bb54f7cac6368cb75d904
2016-10-19 18:12:11 +08:00
Ting-Yu Lin
96fcd3875f
Bug 1311277 Part 2 - Add move assignment for LinkedListElement and LinkedList. r=froydnj
...
MozReview-Commit-ID: 7NjbxamX87U
--HG--
extra : rebase_source : 578c72ee7eff740f7e7dcfd95f38f3ca8d1045a8
2016-10-19 13:30:51 +08:00
Nathan Froyd
d1108c1e52
Bug 1311068 - remove InitializerList.h; r=botond
...
We needed this polyfill for <initializer_list> when some of our C++
standard libraries did not support said header. They all do now, so the
polyfill is redundant.
2016-10-19 00:33:14 -04:00
Jeff Walden
de8974994d
Bug 1299284 - Remove js::IsPowerOfTwo in favor of mozilla::IsPowerOfTwo. r=sfink
...
--HG--
extra : rebase_source : c9d695c25c9e53d7b86d9718611718af9fea8598
2016-07-21 00:36:38 -07:00