Closed Bug 1798953 Opened 4 years ago Closed 4 years ago

Two small gfxSkipCharsIterator cleanups

Categories

(Core :: Layout, defect)

defect

Tracking

()

RESOLVED FIXED
108 Branch
Tracking Status
firefox108 --- fixed

People

(Reporter: dholbert, Assigned: dholbert)

Details

Attachments

(2 external files)

The first patch in bug 1796697 turned out to have surprising perf impact.

I'm spinning this bug off to independently land some of the pieces over there that aren't dependent on that problematic piece and that have no perf impact.

Before this patch, we implicitly invoke the default constructor for this
member-var, and then immediately stomp on the results with a reassignment.

This patch avoids that unnecessary usage of the default constructor, saving
ourslves a bit of work and getting this member-var more directly into a
fully-initialized/valid state.

Attachment #9301820 - Attachment description: Bug 1798953 part 1: Initialize ClusterIterator::mIterator in the init list. → Bug 1798953 part 1: Initialize ClusterIterator::mIterator in the init list. r?jfkthame

In practice, it's only instantiated on the stack; and that's kinda important,
to reduce the likelihood that it somehow outlives the 'gfxSkipChars' instance
that it maintains a raw pointer to and is iterating over.

Pushed by dholbert@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/3ca372ab2cec part 1: Initialize ClusterIterator::mIterator in the init list. r=jfkthame https://hg.mozilla.org/integration/autoland/rev/6d6c7ba89b31 part 2: Annotate gfxSkipCharsIterator as MOZ_STACK_CLASS. r=jfkthame
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 108 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: