Closed Bug 403113 Opened 17 years ago Closed 17 years ago

[FIX]nsCSSFrameConstructor::ProcessPendingRestyles() doesn't need to heap allocate restylesToProcess

Categories

(Core :: CSS Parsing and Computation, defect, P2)

defect

Tracking

()

RESOLVED FIXED
mozilla1.9beta2

People

(Reporter: pavlov, Assigned: bzbarsky)

Details

(Keywords: memory-footprint)

Attachments

(1 file, 1 obsolete file)

I'm seeing a lot of small allocations for restylesToProcess -- would be good to stack allocate them when possible.  maybe use nsAutoTArray?
Attached patch Fix (obsolete) — Splinter Review
Using nsAutoTArray meant either just using it to allocate and nothing else (and messing about with *Elements()) or having it update count all the time, etc.

Didn't seem worth it; this is simple enough.
Attachment #287937 - Flags: superreview?(roc)
Attachment #287937 - Flags: review?(roc)
OS: Windows XP → All
Priority: -- → P2
Hardware: PC → All
Summary: nsCSSFrameConstructor::ProcessPendingRestyles() doesn't need to heap allocate restylesToProcess → [FIX]nsCSSFrameConstructor::ProcessPendingRestyles() doesn't need to heap allocate restylesToProcess
Target Milestone: --- → mozilla1.9 M10
I think you should use nsAutoTArray. You can just call AppendElements() and use the returned pointer. It's less lines of code and safer because the destructor will get called if someone adds a new return path.
Attachment #287937 - Attachment is obsolete: true
Attachment #287937 - Flags: superreview?(roc)
Attachment #287937 - Flags: review?(roc)
Attachment #287940 - Flags: superreview?(roc)
Attachment #287940 - Flags: review?(roc)
Attachment #287940 - Flags: review?
Attachment #287940 - Flags: superreview?(roc)
Attachment #287940 - Flags: superreview+
Attachment #287940 - Flags: review?(roc)
Attachment #287940 - Flags: review+
Attachment #287940 - Flags: approval1.9+
Checked in.
Status: NEW → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: