Closed Bug 1120476 Opened 5 years ago Closed 5 years ago

remove unused |data| field from PLDHashTable

Categories

(Core :: XPCOM, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla38

People

(Reporter: froydnj, Assigned: njn, Mentored)

References

Details

(Whiteboard: [lang=c++][MemShrink])

Attachments

(4 files, 3 obsolete files)

The comment for the field says:

/* ops- and instance-specific data */

We have better ways of handling this than making every hash table instance pay the cost of a pointer field.

A quick scan of all the PL_DHashTableInit calls:

http://mxr.mozilla.org/mozilla-central/search?string=PL_DHashTableInit

and PL_NewDHashTable calls:

http://mxr.mozilla.org/mozilla-central/search?string=PL_NewDHashTable

suggest that almost nobody passes anything but nullptr in for |aData| and those clients that do can be easily fixed.
Whiteboard: [lang=c++] → [lang=c++][MemShrink]
Assignee: nobody → n.nethercote
This one was really easy.
Attachment #8548532 - Flags: review?(nfroyd)
While doing this patch I grepped (case-insensitively) for every occurrence of
"data" in pldhash.{cpp,h} so I'm fairly confident I've found every place that
needed changing.
Attachment #8548533 - Flags: review?(nfroyd)
While doing this patch, I grepped the entire codebase for "PLDHashTableOps" and
"PL.*inalize" and "ash.*inalize" so I think I got all the relevant places.

Also, I improved the comments for Destroy() and Finish() in this patch. In
particular, Finish()'s comment was wrong about leaving pointers dangling, and
the bit about memset() didn't seem useful.
Attachment #8548539 - Flags: review?(nfroyd)
One more comment change.
Attachment #8548588 - Flags: review?(nfroyd)
Attachment #8548539 - Attachment is obsolete: true
Attachment #8548539 - Flags: review?(nfroyd)
Er, let's get that comment right this time.
Attachment #8548589 - Flags: review?(nfroyd)
Attachment #8548588 - Attachment is obsolete: true
Attachment #8548588 - Flags: review?(nfroyd)
Ugh, third time lucky.
Attachment #8548591 - Flags: review?(nfroyd)
Attachment #8548589 - Attachment is obsolete: true
Attachment #8548589 - Flags: review?(nfroyd)
Blocks: 1121304
Attachment #8548531 - Flags: review?(nfroyd) → review+
Attachment #8548532 - Flags: review?(nfroyd) → review+
Attachment #8548533 - Flags: review?(nfroyd) → review+
Blocks: 1121488
Attachment #8548591 - Flags: review?(nfroyd) → review+
You need to log in before you can comment on or make changes to this bug.