Closed
Bug 1157728
Opened 10 years ago
Closed 10 years ago
Useless call in /layout/base/StackArena.h
Categories
(Core :: Layout, defect)
Core
Layout
Tracking
()
RESOLVED
FIXED
mozilla40
Tracking | Status | |
---|---|---|
firefox40 | --- | fixed |
People
(Reporter: Sylvestre, Assigned: shyamvenkatesh95, Mentored)
Details
(Whiteboard: [good first bug][lang=C++][CID 1286400])
Attachments
(1 file, 3 obsolete files)
1.42 KB,
patch
|
dholbert
:
review+
|
Details | Diff | Splinter Review |
https://dxr.mozilla.org/mozilla-central/source/layout/base/StackArena.h?from=StackArena.h#73
gStackArena->Init();
has no effect and should be removed
Init() being only:
nsresult Init() { return mBlocks ? NS_OK : NS_ERROR_OUT_OF_MEMORY; }
Comment 1•10 years ago
|
||
Hi Sylvestre, I would like to work on this bug!
Assignee | ||
Comment 2•10 years ago
|
||
Hey I'd love to work on this bug and I already started. After removing the line specified and running xpcshell on it the following errors were produced.
Summary
=======
Ran 2281 tests (2262 parents, 19 subtests)
Expected results: 2176
Unexpected results: 6 (FAIL: 6)
Skipped: 99
Unexpected Results
==================
js/xpconnect/tests/unit/test_file2.js
-------------------------------------
FAIL [Parent]
js/xpconnect/tests/unit/test_file.js
------------------------------------
FAIL [Parent]
modules/libjar/test/unit/test_bug407303.js
------------------------------------------
FAIL [Parent]
toolkit/components/places/tests/queries/test_sort-date-site-grouping.js
-----------------------------------------------------------------------
Assignee | ||
Comment 3•10 years ago
|
||
Running the build seems to work fine. Maybe the fails are unrelated?
Assignee | ||
Comment 4•10 years ago
|
||
Reporter | ||
Comment 5•10 years ago
|
||
Comment on attachment 8597157 [details] [diff] [review]
Removed the useless call specified.
You have to create a diff, not copy the full file.
See:
https://developer.mozilla.org/fr/docs/Mercurial_Queues#How_to_use_MQ_for_Mozilla_development
Attachment #8597157 -
Flags: review-
Assignee | ||
Comment 6•10 years ago
|
||
Attachment #8597157 -
Attachment is obsolete: true
Reporter | ||
Comment 7•10 years ago
|
||
Please remove the "browser/config/mozconfig" part (and you should use .mozconfig for this) from the patch. Besides that, it is fine.
Reporter | ||
Updated•10 years ago
|
Attachment #8597245 -
Flags: review-
Assignee | ||
Comment 8•10 years ago
|
||
Attachment #8597245 -
Attachment is obsolete: true
Reporter | ||
Comment 9•10 years ago
|
||
OK. Good! Now, try to find who can review this change.
Trick:
In this history of the file, look who reviewed or wrote patches on this file.
Reporter | ||
Updated•10 years ago
|
Assignee: nobody → shyamvenkatesh95
Assignee | ||
Comment 10•10 years ago
|
||
https://hg.mozilla.org/mozilla-central/annotate/22a157f7feb7/layout/base/StackArena.h
From here it seems either the author Ryan VanderMeulen or matspal.
![]() |
||
Comment 11•10 years ago
|
||
matspal or dholbert would be fine choices.
Reporter | ||
Comment 12•10 years ago
|
||
Don't use the annotate, if it is not really efficient for this.
The history itself is better:
https://hg.mozilla.org/mozilla-central/filelog/22a157f7feb7/layout/base/StackArena.h
Assignee | ||
Updated•10 years ago
|
Attachment #8597251 -
Flags: review?(dholbert)
Assignee | ||
Comment 13•10 years ago
|
||
Did I do it right?
Reporter | ||
Comment 14•10 years ago
|
||
You did right!
Assignee | ||
Comment 15•10 years ago
|
||
Great, that was my first bug :D
Thanks for all the help Sylvestre :)
Reporter | ||
Comment 16•10 years ago
|
||
(In reply to Shyam Venkatesh from comment #15)
> Great, that was my first bug :D
Oh, that is not over ;) Daniel might have comments & we have to land the patch once it is reviewed (r+)
Comment 17•10 years ago
|
||
Comment on attachment 8597251 [details] [diff] [review]
bug-1157728-fix.patch
Thanks for taking the bug!
Two requests:
(1) Could you remove the Init() function itself? Nobody calls it after this point, so it's dead code. (And long as an Init() function exists, we technically *should* be calling it before using the object [to do whatever "initialization work" that object needs]. In case case it's useless, as Sylvestre points out -- but in the future, someone could conceivably add more initialization to Init() and expect that it'll be run. To prevent that kind of misunderstanding, we should just remove it.)
(2) Please make your commit message a bit more specific. It's currently:
>Bug 1157728: Removed the useless function call.
Better would be something like:
Bug 1157728: Remove StackArena::Init(), because it doesn't do anything. r=dholbert
(This is more specific now, per (1), you'll be removing the function itself.)
If you repost a patch with those tweaks, I'll mark it r+. Thanks!
Comment 18•10 years ago
|
||
(Some history here: it looks like the point of Init() was to let us determine whether the constructor succeeded in allocating memory for mBlocks. That's no longer necessary, though, because ever since a few years ago, our memory-allocation is infallible -- the allocator simply aborts if it fails, in most cases. So we can assume that "mBlocks" is initialized after the constructor runs, which means Init() is unnecessary.)
Comment 19•10 years ago
|
||
(In reply to Daniel Holbert [:dholbert] from comment #17)
> (And long as an Init() function exists, we
> technically *should* be calling it before using the object [to do whatever
> "initialization work" that object needs]. In case case it's useless
(Sorry for typos; I meant "As long as...", and "In this case...". Clearly I shouldn't try to type first thing in the morning. :))
Comment 20•10 years ago
|
||
Comment on attachment 8597251 [details] [diff] [review]
bug-1157728-fix.patch
Marking first patch revision "r-", since it's not quite ready to land.
(Updated version will be r+, w/ comment 17 addressed -- just tag me for review when you re-post.)
Attachment #8597251 -
Flags: review?(dholbert) → review-
Assignee | ||
Comment 21•10 years ago
|
||
Attachment #8597251 -
Attachment is obsolete: true
Attachment #8597565 -
Flags: review?(dholbert)
Comment 22•10 years ago
|
||
Comment on attachment 8597565 [details] [diff] [review]
Removed StackArena::Init() as well.
Thanks! r=me
Attachment #8597565 -
Flags: review?(dholbert) → review+
Keywords: checkin-needed
Comment 23•10 years ago
|
||
Flags: in-testsuite-
Keywords: checkin-needed
Comment 25•10 years ago
|
||
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla40
You need to log in
before you can comment on or make changes to this bug.
Description
•