Closed Bug 905 Opened 26 years ago Closed 25 years ago

nsFont embedded nsString object

Categories

(Core :: XUL, defect, P2)

x86
Windows NT
defect

Tracking

()

VERIFIED FIXED

People

(Reporter: troy, Assigned: rods)

Details

nsFont objects tend to be used on the stack, e.g. by TextFrame in its Paint() member function, and because nsFont contains a nsString object that allocates space from the heap, we end up with a large number of temporary object generated. We either need to not have nsFont allocate the string from the heap, or re-think the usage pattern: e.g., TextFrame is defining a nsFont instance so it can override the decoration that's in the style information
Assignee: michaelp → peterl
Status: NEW → ASSIGNED
Setting all current Open/Normal to M4.
per leger, assigning QA contacts to all open bugs without QA contacts according to list at http://bugzilla.mozilla.org/describecomponents.cgi?product=Browser
QA Contact: 4110 → 3847
Reassigning qa contact to janc.
Target Milestone: M4 → M7
Target Milestone: M9 → M10
Pushing off non-beta 1 issues
Reassigning peterl's bugs to myself.
Accepting peterl's bugs that have a Target Milestone
Assignee: pierre → trudelle
Status: ASSIGNED → NEW
Component: Compositor → XP Toolkit/Widgets
Triaging my bugs... This one shouldn't be in my list. I had a quick look and below are all the instances of nsFont I found on the stack: nsFormControlHelper::GetFrameFontFM nsFormControlHelper::PaintRectangularButton nsGfxTextControlFrame::Reflow (DEBUG) nsGfxTextControlFrame::InitializeTextControl nsNativeButtonControlFrame::PostCreateWidget nsNativeSelectControlFrame::PostCreateWidget nsNativeSelectControlFrame::PaintSelectControl nsNativeTextControlFrame::PostCreateWidget nsNativeTextControlFrame::PaintTextControl Reassigning to the XPToolkit team.
Assignee: trudelle → rods
I don't see why you're reassigning to XPToolkit, none of these are ours. Ignoring the vestigial native widgets, 3 of the remaining 4 occurrences seem to be checked in by rods, reassigning.
Troy, if we made the nsString in the nsFont object be an nsAutoString, does this solve the problem?
No, I don't think we can do that. We looked at that once before and I think Peter embeds nsFont in his style data structs. Using an nsAutoString would cause the size of the style data structs to go way up
moving to M15
reassigning to Kevin
Assignee: rods → kmcclusk
Reassigning back to Rod.
Assignee: kmcclusk → rods
I changed the usage pattern, there are no longer any nsFont object declared on the stack and textFrame does not declare any on the stack either. This will help memory fragmentation
Status: NEW → RESOLVED
Closed: 25 years ago
Resolution: --- → FIXED
Verified fixt per Troy (Thanks Troy!)
Status: RESOLVED → VERIFIED
January 14, 2008 ---- Test entry
You need to log in before you can comment on or make changes to this bug.