Closed
Bug 1695275
Opened 3 years ago
Closed 3 years ago
PLDHashTable destructor does not need to iterate through entries when entry is trivially destructible
Categories
(Core :: XPCOM, task)
Core
XPCOM
Tracking
()
RESOLVED
FIXED
88 Branch
Tracking | Status | |
---|---|---|
firefox88 | --- | fixed |
People
(Reporter: sg, Assigned: sg)
Details
Attachments
(2 files, 1 obsolete file)
It seems unnecessary to zero the memory of removed entries such as is done by PLDHashTable::ClearEntryStub
.
nsTHashtable::s_ClearEntry
is already a no-op if EntryType
is trivially destructible.
When we know that the clear operation is a no-op, we can skip iterating through all entries in PLDHashTable::~PLDHashTable
entirely.
Assignee | ||
Comment 1•3 years ago
|
||
Depends on D106643
Updated•3 years ago
|
Assignee: nobody → sgiesecke
Status: NEW → ASSIGNED
Assignee | ||
Comment 2•3 years ago
|
||
One thing I might have missed here is that when not clearing, but removing individual entries, it might be necessary to either zero them on removal or on initialization. This seems to be the case for XPCMaps, e.g.
Updated•3 years ago
|
Attachment #9205751 -
Attachment description: Bug 1695275 - Simplify hashtable clearing when EntryType is trivially destructible. r=#xpcom-reviewers → Bug 1695275 - Simplify hashtable clearing when there is no Clear operation. r=#xpcom-reviewers
Assignee | ||
Comment 3•3 years ago
|
||
Depends on D106644
Assignee | ||
Comment 4•3 years ago
|
||
Depends on D106647
Updated•3 years ago
|
Attachment #9205755 -
Attachment is obsolete: true
Pushed by sgiesecke@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/affdc2d452ce Simplify hashtable clearing when there is no Clear operation. r=xpcom-reviewers,nika https://hg.mozilla.org/integration/autoland/rev/945a04ae3805 Simplify hashtable clearing when EntryType is trivially destructible. r=xpcom-reviewers,nika
Comment 6•3 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/affdc2d452ce
https://hg.mozilla.org/mozilla-central/rev/945a04ae3805
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
status-firefox88:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → 88 Branch
You need to log in
before you can comment on or make changes to this bug.
Description
•