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)

defect

Tracking

()

VERIFIED FIXED
mozilla0.9

People

(Reporter: waterson, Assigned: waterson)

References

Details

Attachments

(2 files)

The JSDHashTable and PLDHashTable implementations should clear the live entries in [JS|PL]_DHashTableFinish().
Blocks: 68213
Status: NEW → ASSIGNED
Priority: -- → P2
Target Milestone: --- → mozilla0.9
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
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.
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
With no unconditional i++ at the end of the loop, how could I say no? sr=shaver
Fix checked in.
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
Marking Verified -
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: