Closed Bug 1628697 Opened 5 years ago Closed 5 years ago

nsTArray::AppendElements(mozilla::Span<const Item> aSpan) should use ActualAlloc

Categories

(Core :: XPCOM, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla77
Tracking Status
firefox77 --- fixed

People

(Reporter: sg, Assigned: sg)

Details

Attachments

(1 file)

Currently, the overload always uses FallibleAlloc, which seems wrong:

  template <class Item, typename ActualAlloc = Alloc>
  elem_type* AppendElements(mozilla::Span<const Item> aSpan) {
    return AppendElements<Item, FallibleAlloc>(aSpan.Elements(),
                                               aSpan.Length());
  }

This should be changed to

  template <class Item, typename ActualAlloc = Alloc>
  elem_type* AppendElements(mozilla::Span<const Item> aSpan) {
    return AppendElements<Item, ActualAlloc>(aSpan.Elements(),
                                               aSpan.Length());
  }
Component: MFBT → XPCOM
Pushed by sgiesecke@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/461171bd07fe nsTArray::AppendElements(mozilla::Span<const Item> aSpan) should use ActualAlloc. r=xpcom-reviewers,erahm
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla77
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: