Closed
Bug 1202526
Opened 9 years ago
Closed 9 years ago
Add to PLDHashTable the ability to remove an already-found entry
Categories
(Core :: XPCOM, defect)
Core
XPCOM
Tracking
()
RESOLVED
FIXED
mozilla43
Tracking | Status | |
---|---|---|
firefox43 | --- | fixed |
People
(Reporter: n.nethercote, Assigned: n.nethercote)
References
Details
Attachments
(8 files)
3.65 KB,
patch
|
froydnj
:
review+
|
Details | Diff | Splinter Review |
1.31 KB,
patch
|
mcmanus
:
review+
|
Details | Diff | Splinter Review |
1.26 KB,
patch
|
bzbarsky
:
review+
|
Details | Diff | Splinter Review |
2.18 KB,
patch
|
bzbarsky
:
review+
|
Details | Diff | Splinter Review |
1.51 KB,
patch
|
keeler
:
review+
|
Details | Diff | Splinter Review |
1.10 KB,
patch
|
bzbarsky
:
review+
|
Details | Diff | Splinter Review |
1.02 KB,
patch
|
froydnj
:
review+
|
Details | Diff | Splinter Review |
2.95 KB,
patch
|
mccr8
:
review+
|
Details | Diff | Splinter Review |
(This is a slightly modified version of bug 848609.)
A very common use case for a hash table is this:
(1) lookup item
(2) do something with it
(3) remove it
With pldhash, for step (3) you either have to Remove(), which repeats the search, or use RawRemove(), which does not subsequently shrink the table if its capacity gets too low.
This bug is about adding a new function that takes an already found entry (like RawRemove()) but also shrinks the table afterwards if appropriate (like Remove()). And then using it when appropriate.
Assignee | ||
Comment 1•9 years ago
|
||
This patch also consolidates the shrink handling so it's now entirely within
ShrinkIfAppropriate().
Attachment #8658009 -
Flags: review?(nfroyd)
Assignee | ||
Updated•9 years ago
|
Assignee: nobody → n.nethercote
Status: NEW → ASSIGNED
Assignee | ||
Comment 2•9 years ago
|
||
This assumes that it's safe to possibly shrink the table after the removal,
i.e. there are no surprising subtleties with how this table is managed.
Attachment #8658010 -
Flags: review?(mcmanus)
Assignee | ||
Comment 3•9 years ago
|
||
This assumes that it's safe to possibly shrink the table after the removal,
i.e. there are no surprising subtleties with how this table is managed.
Attachment #8658011 -
Flags: review?(bzbarsky)
Assignee | ||
Comment 4•9 years ago
|
||
This assumes that it's safe to possibly shrink the table after the removal,
i.e. there are no surprising subtleties with how this table is managed.
Attachment #8658012 -
Flags: review?(bzbarsky)
Assignee | ||
Comment 5•9 years ago
|
||
This avoids repeating the hash table search in order to remove the entry.
Attachment #8658014 -
Flags: review?(dkeeler)
Assignee | ||
Comment 6•9 years ago
|
||
This avoids repeating the hash table search in order to remove the entry.
Attachment #8658015 -
Flags: review?(bzbarsky)
Assignee | ||
Comment 7•9 years ago
|
||
This avoids repeating the hash table search in order to remove the entry.
Attachment #8658016 -
Flags: review?(nfroyd)
Assignee | ||
Comment 8•9 years ago
|
||
This avoids repeating the hash table search in order to remove a CC graph
entry, which is good because it's a common operation.
Attachment #8658017 -
Flags: review?(continuation)
Updated•9 years ago
|
Attachment #8658017 -
Flags: review?(continuation) → review+
Updated•9 years ago
|
Attachment #8658010 -
Flags: review?(mcmanus) → review+
Updated•9 years ago
|
Attachment #8658014 -
Flags: review?(dkeeler) → review+
Updated•9 years ago
|
Attachment #8658009 -
Flags: review?(nfroyd) → review+
Updated•9 years ago
|
Attachment #8658016 -
Flags: review?(nfroyd) → review+
Assignee | ||
Updated•9 years ago
|
Blocks: modernize-pldhash
Comment 9•9 years ago
|
||
Comment on attachment 8658011 [details] [diff] [review]
(part 3) - Avoid PL_DHashTableRawRemove() in nsDocument
r=me
Attachment #8658011 -
Flags: review?(bzbarsky) → review+
Comment 10•9 years ago
|
||
Comment on attachment 8658012 [details] [diff] [review]
(part 4) - Avoid PL_DHashTableRawRemove() in nsPropertyTable
r=me
Attachment #8658012 -
Flags: review?(bzbarsky) → review+
Comment 11•9 years ago
|
||
Comment on attachment 8658015 [details] [diff] [review]
(part 6) - Use PLDHashTable::RemoveEntry() in XULDocument
r=me
Attachment #8658015 -
Flags: review?(bzbarsky) → review+
Assignee | ||
Comment 12•9 years ago
|
||
Try looks good: https://treeherder.mozilla.org/#/jobs?repo=try&revision=cda97f7f4516
(Ignore all the red W tests in that push. There was some problem with them when I did the push.)
Comment 13•9 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/6d21d79e8abb
https://hg.mozilla.org/integration/mozilla-inbound/rev/19103f4ad55d
https://hg.mozilla.org/integration/mozilla-inbound/rev/59fea40ba289
https://hg.mozilla.org/integration/mozilla-inbound/rev/438b7e68c23a
https://hg.mozilla.org/integration/mozilla-inbound/rev/aa827e8bdba2
https://hg.mozilla.org/integration/mozilla-inbound/rev/38e1c1c1bdc7
https://hg.mozilla.org/integration/mozilla-inbound/rev/1ff0bf051b24
https://hg.mozilla.org/integration/mozilla-inbound/rev/2afc19650063
Comment 14•9 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/6d21d79e8abb
https://hg.mozilla.org/mozilla-central/rev/19103f4ad55d
https://hg.mozilla.org/mozilla-central/rev/59fea40ba289
https://hg.mozilla.org/mozilla-central/rev/438b7e68c23a
https://hg.mozilla.org/mozilla-central/rev/aa827e8bdba2
https://hg.mozilla.org/mozilla-central/rev/38e1c1c1bdc7
https://hg.mozilla.org/mozilla-central/rev/1ff0bf051b24
https://hg.mozilla.org/mozilla-central/rev/2afc19650063
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla43
You need to log in
before you can comment on or make changes to this bug.
Description
•