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

404 Коммитов

Автор SHA1 Сообщение Дата
Jeff Walden d243be25b1 Bug 1426909 - Abstract out mozilla::DecodeOneUtf8CodePoint for decoding a UTF-8 code point after having consumed a non-ASCII lead unit, with configurable error notification through optional user-provided functors. r=froydnj
--HG--
extra : rebase_source : 25836018b00b545a60969abccf40ce313d4da1af
2018-07-12 17:41:31 -07:00
Jeff Walden 90507ffb7a Bug 1426909 - Introduce a new mfbt/Utf8.h header for UTF-8-related functionality, including a UTF-8 code unit type that is compatible with, but doesn't directly interconvert with, |char|. r=froydnj
--HG--
extra : rebase_source : 00760186060d7e72fac783af3fc5595a6057feca
2018-01-11 11:29:53 -07:00
Andi-Bogdan Postelnicu 4a5d0dd615 Bug 1453795 - MFTB - Initialize member fields in classes/ structures. r=waldo
--HG--
extra : rebase_source : e091acb3a9f60695b87ab9e3d348c5978680d2f8
2018-06-15 13:49:31 +03:00
Alessio Placitelli 1ecfce2746 Bug 1467759 - Escape all the property names in JSONWriter. r=froydnj
Scalar property names (e.g. IntProperty) are already escaped correctly.
This patch escapes the collection property names (e.g. StartObjectProperty)
as well (and adds test coverage for it).

MozReview-Commit-ID: 68kkjPb2ZN7

--HG--
extra : rebase_source : b42939ccebb71fc73914ff595803b2d6c7df2715
2018-06-08 19:50:25 +02:00
Jeff Walden c55625cdec Bug 1467336 - Implement mozilla::IsAscii to detect pure ASCII characters. r=froydnj
--HG--
extra : rebase_source : 1f6de2745234766d676178bdeafb9b82e48e51b5
2018-06-07 02:17:10 -07:00
Jeff Walden 701bad47cd Bug 1438212 - Implement mozilla::IsFloat32Representable using an algorithm that handles NaN correctly and doesn't sometimes invoke undefined behavior. r=froydnj
--HG--
extra : rebase_source : b4246ea818046b1e4100b90a3a371a866ea2b098
2018-06-06 16:03:47 -07:00
André Bargull f7acf7bc9c Bug 1466909 - Use AddLvalueReference for UniquePtr's operator*(). r=froydnj
--HG--
extra : rebase_source : df072aca7e79ce534c3bc620a352adfc92fbf245
2018-06-07 07:27:22 -07:00
Henri Sivonen c3fcb6ab2c Bug 1466475 - Make mozilla::Span produce aligned bogus pointers per new Rust rules. r=froydnj
MozReview-Commit-ID: JFVSRu53Geh

--HG--
extra : rebase_source : a9436aef554b6e892195324744f135d2b65086d5
2018-06-04 12:59:46 +03:00
Miko Mynttinen 4c85ef17cc Bug 1465060 - Part 1: Fix warnings for std::move() use r=froydnj
MozReview-Commit-ID: HpdFXqQdIOO

--HG--
extra : rebase_source : 1e7eea4f2d4ec16ec0c559a8afb26976ddbf4d07
2018-06-01 17:59:07 +02:00
arthur.iakab 7e765f798b Backed out 2 changesets (bug 1465060) for build bustages on security/sandbox/linux/reporter/SandboxReporter.cpp
Backed out changeset 7c8905b6b226 (bug 1465060)
Backed out changeset 10446073eca8 (bug 1465060)
2018-06-03 19:25:41 +03:00
Miko Mynttinen 8d9dc85cd4 Bug 1465060 - Part 1: Fix warnings for std::move() use r=froydnj
MozReview-Commit-ID: HpdFXqQdIOO

--HG--
extra : rebase_source : 619d0e0ff63a2453c80f0c4d9beb906d43fa9b01
2018-06-01 17:59:07 +02: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
Paul Adenot 515134e9a0 Bug 1454385 - Add a single producer single consumer lock and wait free queue to mfbt/. r=froydnj
MozReview-Commit-ID: 6Dq0GQtYgv2

--HG--
extra : rebase_source : 67bc4245a61c15738e3a6467a03b41e9e29af9ce
2018-04-13 17:14:05 +02:00
Alex Gaynor 3511d14f46 Bug 1462912 - fixed BufferList::Extract to handle the case where the call consumes the entirety of the BufferList; r=froydnj
MozReview-Commit-ID: 1LWODn8JaNL

--HG--
extra : rebase_source : 29cea444a49eb5e2ade33214ff52d6419949337e
2018-05-22 13:04:59 -04:00
Alex Gaynor a13531321e Bug 1456189 - Simplify BufferList::Extract to make the lifetimes clearer. r=froydnj 2018-05-18 18:59:00 -04:00
Gurzau Raul 841689c6d7 Backed out changeset 1d0aa0c581cf (bug 1456189) for bustage on selftest.py on a CLOSED TREE 2018-05-18 01:00:26 +03:00
Alex Gaynor bb3ec615d6 Bug 1456189 - Simplify BufferList::Extract to make the lifetimes clearer. r=froydnj 2018-05-17 17:16:43 -04:00
Gerald Squelart 9b8e47ab12 Bug 1448494 - NonDereferenceable<T> wraps a T* and prevents dereferencing ops - r=froydnj
NonDereferenceable denotes the intent that a pointer will (most likely) not be
dereferenced, but its numeric value may be used for e.g. logging purposes.

Dereferencing operations are explicitly disabled to avoid unintentional misuses.
Casting is still possible between related types (same as with raw pointers),
but pointers stay safely stored inside NonDereferenceable objects. These casts
do not trigger `clang++ -fsanitize=vptr` errors.

MozReview-Commit-ID: 5885pB7hSFR

--HG--
extra : rebase_source : 3c4011da64d84f1b19991742b76bafbffa90d590
2018-03-28 17:48:53 +11:00
Jon Coppeard edcb15ad07 Bug 1456875 - Add const iterators for LinkedList r=Waldo 2018-04-30 10:21:31 +01:00
Jeff Walden 821db93ccc Bug 1453456 - Replace nsCRT::IsAscii{Alpha,Digit} with mfbt/TextUtils.h versions. r=froydnj
--HG--
extra : rebase_source : b31986c0e6828be79442cfb0cf369eb80c232139
2018-04-12 20:19:30 -07:00
Jeff Walden 9ea9bcc2df Bug 1453456 - Add/use more ASCII alphanumeric testing/conversion functions from MFBT in SpiderMonkey code in various places. r=froydnj
--HG--
extra : rebase_source : b4e05102cce2ad5dabb973a3968f1112376da594
2018-04-10 11:42:54 -07:00
Sebastian Hengst 0819f35e51 Backed out 4 changesets (bug 525063) on request from Andi. a=backout
Backed out changeset 516c4fb1e4b8 (bug 525063)
Backed out changeset 6ff8aaef2866 (bug 525063)
Backed out changeset bf13e4103150 (bug 525063)
Backed out changeset d7d2f08e051c (bug 525063)
2018-04-13 16:01:28 +03:00
Tristan Bourvon a3a77c0312 Bug 525063 - Initialize uninitialized class attributes in m-c. r=ehsan 2018-04-10 21:11:02 +02:00
Jeff Walden be8ccd5a6b Bug 1452619 - Implement mozilla::IsAsciiAlpha. r=froydnj
--HG--
extra : rebase_source : fd1e3284d293edad0bd96cc378eeeeb1bc2c8829
2018-04-09 12:02:43 -07:00
Masatoshi Kimura 3560ad5b6e Bug 1449094 - Implement constexpr mozilla::AllOf. r=froydnj
MozReview-Commit-ID: KvKY9CMqfww

--HG--
extra : rebase_source : 5e548884d3a331b5dc8704a690ccbd532ac2534a
2018-03-28 00:01:08 +09:00
Henri Sivonen 5f81ea7f50 Bug 1448591 - Make MakeStringSpan(nullptr) return an empty span. r=froydnj.
MozReview-Commit-ID: EyuLeWjEL7w

--HG--
extra : rebase_source : a40b671692db0e7faa7772654cb4b1ae75bd30a2
2018-03-24 21:36:00 +02:00
Bogdan Tara 8b1819017d Backed out changeset 577c20417552 (bug 1449094) for failing /builds/worker/workspace/build/src/mfbt/tests/TestAlgorithm.cpp CLOSED TREE 2018-03-30 01:54:04 +03:00
Masatoshi Kimura 316aea87d9 Bug 1449094 - Implement constexpr mozilla::AllOf. r=froydnj
MozReview-Commit-ID: KvKY9CMqfww

--HG--
extra : rebase_source : 15efd61da5b66d6bbb4655cf95936c5d36473a82
2018-03-28 00:01:08 +09:00
Jeff Walden 0eefeabe25 Bug 1445024 - Implement mozilla::WrappingSubtract. r=froydnj
--HG--
extra : rebase_source : 026268df1cb1cfc56873e61834ea90257645c508
2018-03-06 19:22:20 -08:00
Jeff Walden 52d9907ee0 Bug 1445024 - Implement mozilla::WrappingAdd. r=froydnj
--HG--
extra : rebase_source : 3514c6487305e64ce19060cb05d39bc6eb2fd912
2018-03-06 19:21:58 -08:00
Jeff Walden 15bf6fd876 Bug 1442967 - Boo, MSVC warns when a cast will truncate a numeric constant. Arguably a desirable warning generally, but here we specifically intend the cast to narrow, so disable the warning. r=me in a CLOSED TREE 2018-03-12 19:20:42 -07:00
Jeff Walden fc7dc7e60e Bug 1442967 - When doing a comparison against a 64-bit constant in code run only in 64-bit builds, but compiled in 32-bit builds, cast it to uintptr_t so that the comparison isn't clearly false in 32-bit builds. rs=froydnj by suggestion on IRC
--HG--
extra : rebase_source : 2be98a1a0c436664ea0fa3ef8be55a9fb71541af
2018-03-12 13:36:44 -07:00
Jeff Walden 1b063823be Bug 1442967 - Futz with a uintptr_t (as uint32_t) == uint64_t comparison to evade constantly-false compiler warnings in 32-bit builds. r=jorendorff 2018-03-09 21:59:08 -08:00
Jason Orendorff ef8693d6f2 Bug 1413049 - Part 1a: In a test, zero-pad hex integer constants to the width of their type. r=Waldo.
--HG--
extra : rebase_source : dfd3f1a00470856a177a526d385dd0f1b7d0ec38
2018-03-01 20:06:37 -06:00
Jason Orendorff 2418dfb4b3 Bug 1413049 - Part 1: Add methods to EndianUtils for pointer-sized integers. r=Waldo.
--HG--
extra : rebase_source : 115e40ecaee589b07e4ff9534694e56af7690e9b
2018-03-01 11:05:13 -06:00
Jeff Walden 25a7df6306 Bug 1441657 - Implement mozilla::WrappingMultiply. r=froydnj
--HG--
extra : rebase_source : 57d1796976a25597ee4dda90561d40debc6a9fc9
2018-02-15 17:36:55 -08:00
Jeff Walden b0074d3a7d Bug 1441657 - Create a new mozilla/WrappingOperations.h header to contain implementations of common math operations with well-defined wraparound semantics. r=froydnj
--HG--
rename : mfbt/MathAlgorithms.h => mfbt/WrappingOperations.h
rename : mfbt/tests/TestMathAlgorithms.cpp => mfbt/tests/TestWrappingOperations.cpp
extra : rebase_source : 552a0f17d7ba2ad6229d45fd2945592aceabb354
2018-02-15 17:36:50 -08:00
Jeff Walden 1b16de9738 Bug 744965 - Implement mozilla::NumberEqualsInt32 in a way that doesn't depend on undefined behavior casting an out-of-range floating point number to int32_t. r=froydnj
--HG--
extra : rebase_source : dc4781e2a31ee0e75fc62951cbdc71eaa9fd7b1c
2018-02-15 17:22:14 -08:00
Cosmin Sabou 48de1e7807 Backed out changeset 1fcc972d445b (bug 744965) for assertion failures on TestFloatingPoint.cpp on a CLOSED TREE 2018-02-21 10:12:45 +02:00
Jeff Walden e77ef331a3 Bug 744965 - Implement mozilla::NumberEqualsInt32 in a way that doesn't depend on undefined behavior casting an out-of-range floating point number to int32_t. r=froydnj
--HG--
extra : rebase_source : d6d890b7b20d93297f575abe838e8619418ea545
2018-02-15 17:22:14 -08:00
Jeff Walden 51f84c53a8 Bug 1432646 - Followup bustage fix for compilers that warn (error with -Werror-alike) when negating an unsigned expression. r=bustage in a CLOSED TREE 2018-01-27 00:25:40 -08:00
Jeff Walden 8314131139 Bug 1432646 - Implement mozilla::WrapToSigned. r=froydnj
--HG--
extra : rebase_source : 2c1a216830767da789eea59d00b55a45845f4d60
2018-01-25 14:48:01 -08: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
Sylvestre Ledru c911c249ec Bug 1424866 - Update the comment for fix a warning: unnecessary parentheses in declaration of 'type name' r=gerald DONTBUILD 2018-01-04 11:59:13 +01:00
Sylvestre Ledru 530203c95e Bug 1424866 - Fix a warning: unnecessary parentheses in declaration of 'type name' r=gerald
MozReview-Commit-ID: CBOTKHgqDfV

--HG--
extra : rebase_source : cc9d339008e7024b5406153bad37e4d717c7ae59
2018-01-03 17:43:04 +01: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
Alfredo.Yang 0000c37a97 Bug 1419682 - add unwrap_or() for Result. r=Waldo
MozReview-Commit-ID: FmPvPzUmN9j

--HG--
extra : rebase_source : d5d3b3ca42b839b82886512ada8bc49551a60d8a
2017-11-22 17:14:28 +08:00
Gerald Squelart 5bea7c3a56 Bug 1410252 - MakeNotNull<PointerType, OptionalPointeeType>(Args...) - r=njn
MakeNotNull is similar to UniquePtr, in that it combines the infallible
allocation and construction of an object on the heap and wraps the (raw or
smart) pointer into a NotNull.
It skips the unnecessary null check from WrapNotNull, and removes the usual
naked 'new' used in many WrapNotNull calls.

MozReview-Commit-ID: UwCrhDnkUg

--HG--
extra : rebase_source : 5a027165fc17ed748783c7ffda03eb421865ad6e
2017-10-20 14:56:01 +11:00
Lee Salzman 70cd2a8499 Bug 1404742 - add test for ThreadSafeWeakPtr. r=nfroyd
MozReview-Commit-ID: GkNXsTLcN7m
2017-10-18 14:21:27 -04:00
Mike Hommey 9f2dd4775e Bug 1407468 - Replace multiple !JS_STANDALONE with MOZ_WIDGET_TOOLKIT. r=mshal
--HG--
extra : rebase_source : 4f9f9f583c3422ed0f8d1d65ea8e7575bd9baf2c
2017-10-05 14:50:01 +09:00
Chris Peterson a48326552c Bug 1405582 - Span: delete implicit constructors for char* and char16_t*. r=froydnj,hsivonen
Delete Span's implicit constructors for char* and char16_t* pointers to avoid accidental construction in cases where a pointer does not point to a zero-terminated string. Use the MakeStringSpan() function instead.

I deleted both the const and non-const char* and char16_t* constructors, in the name of cross-compiler consistency. If we only delete the const char* and char16_t* constructors, for some reason, MSVC complains that `Span<char> s(charArray)` uses a deleted constructor while clang nor gcc permit it. I don't know if this is a compiler bug in MSVC or clang and gcc.

Also, do not permit MakeSpan() for string literals (const char and char16_t arrays) because the Span length would include the zero terminator, which may surprise callers. Use MakeStringSpan() to create a Span whose length that excludes the string literal's zero terminator or use the MakeSpan() overload that accepts a pointer and length and specify the string literal's full length.

The following Span usages are prevented:

  Span<const char> span("literal"); // error
  Span<char> span(charArray); // error

  Span<const char> span;
  span = "literal"; // error
  span = charArray; // error

  MakeSpan("literal"); // error

The following Span usages are still permitted:

  assert(MakeStringSpan("literal") == 8); // OK: span length is calculated with strlen() and excludes the zero terminator
  MakeStringSpan(charArray); // OK: span length is calculated with strlen() and excludes the zero terminator
  MakeSpan(charArray); // OK: span length is the char array size including any zero terminator

MozReview-Commit-ID: Et71CpjsiyI

--HG--
extra : rebase_source : f6f8bdb28726f0f2368fdfdd039fb1d7dcf2914e
extra : source : 0547d8924ffc7713d6cf32cc06eeeaf00e0d69a3
2017-09-20 00:38:07 -07:00
Luke Wagner bb375a16d4 Bug 1329019 - Allow specifying capacity to Vector::replaceRawBuffer (r=froydnj)
MozReview-Commit-ID: 9Eq6PR53n4i
2017-09-22 10:34:24 -05:00
Luke Wagner 231c33a9fe Bug 1329019 - Vector::podResizeToFit should update reserved (r=froydnj)
MozReview-Commit-ID: CkoNRjxmjom
2017-09-22 10:33:36 -05:00
Matt Woodrow a56e3551a2 Bug 1397056 - Add Contains and a return parameter to Remove for SmallPointerArray. r=froydnj
* * *
[mq]: fix

MozReview-Commit-ID: 5laM7PQLP7X
2017-09-12 14:11:47 -04:00
Wes Kocher b1233c7d04 Backed out changeset 371a03aa9b24 (bug 1397056) for build errors in SmallPointerArray.h a=backout CLOSED TREE
MozReview-Commit-ID: FNVPjKmVCWB

--HG--
extra : rebase_source : 41e380e59d9eead945ba515d85c1b9195329bc74
2017-09-12 12:39:09 -07:00
Matt Woodrow 5675f29866 Bug 1397056 - Add Contains and a return parameter to Remove for SmallPointerArray. r=froydnj
* * *
[mq]: fix

MozReview-Commit-ID: 5laM7PQLP7X

--HG--
extra : rebase_source : f1baa7c1581fcc864d2b548989e967f57e24b921
2017-09-12 14:11:47 -04:00
Mike Hommey 0d8ed2b1a5 Bug 1396723 - Simplify the trait users of DoublyLinkedList need to define. r=froydnj
While the flexibility of the current trait is nice, it's actually not
used to its fullest anywhere, and is boilerplate-y. While it is useful
to be able to put the links anywhere, there's not much usefulness from
being able to split mNext and mPrev.

So instead of a trait that allows to get/set mNext and mPrev
independently, we just use a trait that tells how to get a reference to
a DoublyLinkedListElement from a list element itself.

--HG--
extra : rebase_source : 674277bac4fc979f2e483a77b5ef1495baccc7fe
2017-09-02 08:09:58 +09: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
Phil Ringnalda bc78097d88 Backed out 2 changesets (bug 1396723) for !ElementAccess::Get(mHead).mPrev assertion failures
Backed out changeset 4f17343164b6 (bug 1396723)
Backed out changeset b744eba9ca78 (bug 1396723)

MozReview-Commit-ID: JbvM6oMxEFl
2017-09-06 21:39:20 -07:00
Mike Hommey b16f4035ba Bug 1396723 - Simplify the trait users of DoublyLinkedList need to define. r=froydnj
While the flexibility of the current trait is nice, it's actually not
used to its fullest anywhere, and is boilerplate-y. While it is useful
to be able to put the links anywhere, there's not much usefulness from
being able to split mNext and mPrev.

So instead of a trait that allows to get/set mNext and mPrev
independently, we just use a trait that tells how to get a reference to
a DoublyLinkedListElement from a list element itself.

--HG--
extra : rebase_source : f84c5799c305a4a3b7dc5deb727a05d4d537bb15
2017-09-02 08:09:58 +09:00
Wes Kocher f66c96f2c8 Backed out 2 changesets (bug 1396723) for build failures in TestDoublyLinkedList.cpp a=backout
Backed out changeset 1c0f9d069ade (bug 1396723)
Backed out changeset 6ca94a450b81 (bug 1396723)

MozReview-Commit-ID: 2w3WTvhpg6J
2017-09-06 14:30:41 -07:00
Mike Hommey 9a3dd41f50 Bug 1396723 - Simplify the trait users of DoublyLinkedList need to define. r=froydnj
While the flexibility of the current trait is nice, it's actually not
used to its fullest anywhere, and is boilerplate-y. While it is useful
to be able to put the links anywhere, there's not much usefulness from
being able to split mNext and mPrev.

So instead of a trait that allows to get/set mNext and mPrev
independently, we just use a trait that tells how to get a reference to
a DoublyLinkedListElement from a list element itself.

--HG--
extra : rebase_source : b7d502754a764670e291acdd56726948db935497
2017-09-02 08:09:58 +09:00
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