Closed Bug 1385533 Opened 7 years ago Closed 7 years ago

Consider reserving space for one pointer in mMutationObservers

Categories

(Core :: DOM: Core & HTML, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla56
Tracking Status
firefox56 --- fixed

People

(Reporter: ehsan.akhgari, Assigned: ehsan.akhgari)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

This way setting an input value for example won't incur an allocation here when a range gets created for the selection, and we won't be growing the slot by too much.

We still have the static asserts in FragmentOrElement.cpp imposing a maximum size on our slots.
This helps avoid allocations for the first mutation observer (for example, Range)
created by a caller.
Attachment #8891596 - Flags: review?(bugs)
(The macros in nsTObserverArray.h are copied from similar macros adjacent to them, just changing the array type used in them.)
Attachment #8891596 - Flags: review?(bugs) → review+
Pushed by eakhgari@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/559f7f92c891
Reserve space for one pointer in the mMutationObservers array on node slots; r=smaug
https://hg.mozilla.org/mozilla-central/rev/559f7f92c891
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla56
Assignee: nobody → ehsan
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.