Closed Bug 1171282 Opened 10 years ago Closed 10 years ago

Avoid some unnecessary |operator new| null-checks in layout/

Categories

(Core :: Layout, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla41
Tracking Status
firefox41 --- fixed

People

(Reporter: n.nethercote, Assigned: n.nethercote)

References

Details

Attachments

(1 file)

AllocateByObjectID() is infallible. Therefore the |operator new| of nsFrameList, nsLineBox and nsRuleNode are too, as is nsRuleNode::CreateRootNode(). The patch also removes a couple of comments duplicated in both .h and .cpp files.
Did some brief hg archeology to be sure this stuff is really supposed to be infallible. Looks like it is, which is good. In particular: (1) bug 809533 made nsPresArena allocation infallible. (and nsIPresShell::AllocateByObjectID uses nsPresArena for allocation) (2) bug 899385 documented the fact that AllocateByObjectID is infallible (in mozilla-central changeset 627c3d68be29) Setting dependency on those bugs.
Depends on: 899385, 809533
Version: unspecified → Trunk
Comment on attachment 8614998 [details] [diff] [review] Avoid some unnecessary |operator new| null-checks in layout/ Looks good. r=me
Attachment #8614998 - Flags: review?(dholbert) → review+
Thank you for the fast and careful review.
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla41
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: