Closed
Bug 114166
Opened 23 years ago
Closed 23 years ago
rewrite nsDeque
Categories
(Core :: XPCOM, defect)
Core
XPCOM
Tracking
()
RESOLVED
FIXED
People
(Reporter: akkzilla, Assigned: timeless)
References
Details
Attachments
(1 file, 9 obsolete files)
1.65 KB,
patch
|
darin.moz
:
superreview+
asa
:
approval+
|
Details | Diff | Splinter Review |
nsDeque has various repeated comments, comments that refer to functions other
than the function they preceed, etc. Timeless has volunteered to clean it up.
I can review.
there are 2 silly whitespaces in the license block!!
I think i still plan to commit the code rewrite as a separate cvs pass.
1. removing all @updates. cvs log/blame handle this
2. % isn't guaranteed. See long comment in patch
3. ::PopFront diffed really poorly. here's the code:
void* nsDeque::PopFront() {
void* result=0;
if (mSize>0) {
NS_ASSERTION(mOrigin < mCapacity, "Error: Bad origin");
result=mData[mOrigin];
mData[mOrigin++]=0; //zero it out for debugging purposes.
mSize--;
// Cycle around if we pop off the end
// and reset origin if when we pop the last element
if (mCapacity==mOrigin || !mSize) {
mOrigin=0;
}
}
return result;
}
Attachment #61239 -
Attachment is obsolete: true
I've been running with this patch for two months i guess.
Attachment #61240 -
Attachment is obsolete: true
Attachment #61333 -
Attachment is obsolete: true
some callers do bad things, peeking empty deques, iterating past the end of
their deque.
Attachment #70202 -
Attachment is obsolete: true
OS: Linux → All
Hardware: PC → All
Summary: nsDeque has confusing comments → rewrite nsDeque
Updated•23 years ago
|
Attachment #70194 -
Flags: superreview+
Comment 8•23 years ago
|
||
Comment on attachment 70194 [details]
mozilla/xpcom/tests/TestDeque.cpp
rs=alecf
Comment 9•23 years ago
|
||
Comment on attachment 70195 [details] [diff] [review]
current patch from my tree
I guess this looks ok - much of it is just reformatting existing code, but I
think I understand the bounds issues as well. sr=alecf
(I'm assuming akkana will also give this a good r=)
Attachment #70195 -
Flags: superreview+
Reporter | ||
Comment 10•23 years ago
|
||
r=akkana on 70195 ("current patch from my tree") and 70205 ("really fix
callers"), with a few changes that timeless and I discussed (add a few more
clarifying comments, fix three lines in nsFind.cpp, remove a line from the test
makefile).
In addition to cleaning up and documenting the code, this also fixes a crash in
the new editor find and replace dialog (it was disabled because it was crashing
in nsDeque code) and so will unblock bug 80805.
Blocks: 80805
Assignee | ||
Comment 11•23 years ago
|
||
i'm changing the signature of GrowCapacity, it's only used internally and it
means that I can almost return an error if GrowCapacity can't grow.
Attachment #70194 -
Attachment is obsolete: true
Attachment #70195 -
Attachment is obsolete: true
Assignee | ||
Comment 12•23 years ago
|
||
the new find incorrectly used an iterator, fix is here and the much better
comments explains what was being done wrong.
Attachment #70205 -
Attachment is obsolete: true
Reporter | ||
Comment 13•23 years ago
|
||
r=akkana on the new changes -- the improved comments, the new GrowCapacity
signature, and the nsFind fix.
Comment 14•23 years ago
|
||
Note that this checkin caused the regression described in bug 126797, which kin
has fixed.
Updated•23 years ago
|
Keywords: mozilla1.0+
Assignee | ||
Comment 15•23 years ago
|
||
Attachment #70431 -
Attachment is obsolete: true
Attachment #70433 -
Attachment is obsolete: true
Comment 16•23 years ago
|
||
Comment on attachment 72500 [details] [diff] [review]
last bits of cleanup (typos, one inconsistency in javadoc)
sr=darin
Attachment #72500 -
Flags: superreview+
Comment 17•23 years ago
|
||
Comment on attachment 72500 [details] [diff] [review]
last bits of cleanup (typos, one inconsistency in javadoc)
a=asa (on behalf of drivers) for checkin to the 1.0 trunk
Attachment #72500 -
Flags: approval+
Assignee | ||
Comment 18•23 years ago
|
||
fixed checked into trunk
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•