Closed Bug 1038488 Opened 6 years ago Closed 6 years ago

Use AllocateByObjectID/FreeByObjectID for style structs

Categories

(Core :: CSS Parsing and Computation, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla33

People

(Reporter: dbaron, Assigned: dbaron)

References

Details

Attachments

(3 files, 2 obsolete files)

We should use AllocateByObjectID/FreeByObjectID for style structs.  This would reduce the risk of any errors in managing them.
Oops, those versions had out-of-date commit messages (due to the way bzexport interacts with hand-editing the commit messages in my patch queue).
This also moves those 4 operator new methods to be inline to match the
style of all of the others.

I audited that all the members of these structs are initialized by all
their constructors (see patch 1).
Attachment #8455888 - Flags: review?(cam)
Attachment #8455864 - Attachment is obsolete: true
Attachment #8455864 - Flags: review?(cam)
Attachment #8455865 - Attachment is obsolete: true
Attachment #8455865 - Flags: review?(cam)
Attachment #8455866 - Flags: review?(cam) → review+
Comment on attachment 8455886 [details] [diff] [review]
patch 1 - Explicitly initialize nsStyleMargin::mCachedMargin and nsStylePadding::mCachedPadding so that it is clear all members of nsStyleFont, nsStyleMargin, nsStylePadding, and nsStyleBorder are explicitly initialized

Review of attachment 8455886 [details] [diff] [review]:
-----------------------------------------------------------------

Why mention nsStyleFont and nsStyleBorder in the commit message?
Attachment #8455886 - Flags: review?(cam) → review+
Attachment #8455888 - Flags: review?(cam) → review+
(In reply to Cameron McCormack (:heycam) from comment #7)
> Why mention nsStyleFont and nsStyleBorder in the commit message?

Because those are the other 2 that currently use memset().
You need to log in before you can comment on or make changes to this bug.