Closed Bug 573209 Opened 14 years ago Closed 14 years ago

nsDisplayListBuilder should not be NS_STACK_CLASS

Categories

(Core :: Layout, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: jruderman, Assigned: jruderman)

Details

Attachments

(1 file)

nsDisplayListBuilder is NS_STACK_CLASS
http://hg.mozilla.org/mozilla-central/annotate/5f3f36fe8d76/layout/base/nsDisplayList.h#l121

RangePaintInfo has a nsDisplayListBuilder member
http://hg.mozilla.org/mozilla-central/annotate/5f3f36fe8d76/layout/base/nsPresShell.cpp#l242

RangePaintInfo is heap-allocated
http://hg.mozilla.org/mozilla-central/annotate/5f3f36fe8d76/layout/base/nsPresShell.cpp#l5506

Dunno how bad this is.  Curious why static analysis didn't prevent this.  Noticed it while trying to track down a leak.
Static analysis didn't prevent this because we haven't had a static analysis build running in many months. Ehren is working on resurrecting them as part of the regular debug builds.

nsDisplayListBuilder was NS_STACK_CLASS because at the time I checked it was only heap-allocated and that helped with XPCOMGC. Since XPCOMGC is dead, assuming that the automatic allocation is intentional we should just remove the NS_STACK_CLASS annotation.
I guess I'll also remove the private operator new that prevented direct heap instantiation (added by bz in bug 324969).
Summary: nsDisplayListBuilder gets allocated on the heap sometimes → nsDisplayListBuilder should not be NS_STACK_CLASS
Attached patch patchSplinter Review
Remove NS_STACK_CLASS, remove throwing new, add trace-refcnt instrumentation to ensure we notice leaks.
Assignee: nobody → jruderman
Status: NEW → ASSIGNED
Attachment #452489 - Flags: review?(roc)
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Do we expect anyone to directly heap-allocate this?  If no, should we keep the private operator new?
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: