Greetings,

Over in bug 968520, FallibleTArray is being merged into nsTArray.
After the bug is complete, we will be left with just nsTArray (and
nsAutoTArray). Fallible allocation will be opt-in using the
`mozilla::fallible` parameter just like with ns*String.

As a first step in this transition, it will soon be required to pass
`mozilla::fallible` to allocating FallibleTArray method calls. Note
that you can already use `mozilla::fallible` with both nsTArray and
FallibleTArray (and their Auto variants):

  nsTArray<int> array;
  array.SetCapacity(10);                          // Infallible
  bool result = array.SetCapacity(10, fallible);  // Fallible

  FallibleTArray<int> array;
  array.SetCapacity(10);                          // Compile error (soon)
  bool result = array.SetCapacity(10, fallible);  // Fallible

The commit to enforce this behaviour for FallibleTArrays will land on
mozilla-inbound shortly.

For more information, see: https://bugzilla.mozilla.org/show_bug.cgi?id=968520

Cheers,
Biru
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to