Closed
Bug 73540
Opened 24 years ago
Closed 24 years ago
[JS|PL]DHashTable should clear live entries when finalizing
Categories
(Core :: JavaScript Engine, defect, P2)
Core
JavaScript Engine
Tracking
()
VERIFIED
FIXED
mozilla0.9
People
(Reporter: waterson, Assigned: waterson)
References
Details
Attachments
(2 files)
|
1.32 KB,
patch
|
Details | Diff | Splinter Review | |
|
2.64 KB,
patch
|
Details | Diff | Splinter Review |
The JSDHashTable and PLDHashTable implementations should clear the live entries
in [JS|PL]_DHashTableFinish().
| Assignee | ||
Comment 1•24 years ago
|
||
| Assignee | ||
Updated•24 years ago
|
Comment 2•24 years ago
|
||
waterson observed that Finish didn't, and I said "oh! that's a bug". Thanks to
waterson for filing and patching it.
Nit alert, I still feel parental about this code:
- no tripled newlines (two empty lines) in my code.
- proper sentence style (capitalized first word, full stop at end) in comments
that stand on their own line(s).
More significant, how about METER'ing removeHits++ for better stats?
Finally, should the induction variable i be eliminated, along with capacity, by
setting char *entryLimit; to entryAddr + JS_BIT(table->sizeLog2) * entrySize and
bounding entryAddr < entryLimit in the loop condition? Same goes for Enumerate
(I have no excuse :-), on which this code was based.
/be
| Assignee | ||
Comment 3•24 years ago
|
||
| Assignee | ||
Comment 4•24 years ago
|
||
I went ahead and modified JS_DHashTableEnumerate(), too. It's a wash, because
you trade `i' for `entryAddr'. If you don't like it, I'll revert.
Comment 5•24 years ago
|
||
I like it (I wouldn't have block-scoped entry in Finish, but I'm such a luddite)
and you did eliminate an induction variable in Enumerate, no wash -- it's true
you still need capacity after the loop, so entryLimit adds to register pressure,
but you don't need a = 0 before the loop and a unconditional i++ at the bottom
of the loop.
r/sr=brendan@mozilla.org, anyone on the cc: list care to r=?
/be
Comment 6•24 years ago
|
||
With no unconditional i++ at the end of the loop, how could I say no?
sr=shaver
| Assignee | ||
Comment 7•24 years ago
|
||
Fix checked in.
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•