Closed
Bug 1468036
Opened 6 years ago
Closed 6 years ago
RuntimeService::ClampedHardwareConcurrency() : Calling clampedHardwareConcurrency.compareExchange(0U, clampedValue) is only useful for its return value, which is ignored.
Categories
(Core :: DOM: Service Workers, defect, P2)
Core
DOM: Service Workers
Tracking
()
RESOLVED
FIXED
mozilla62
Tracking | Status | |
---|---|---|
firefox62 | --- | fixed |
People
(Reporter: Sylvestre, Assigned: baku)
References
(Blocks 1 open bug)
Details
(Keywords: coverity, Whiteboard: [CID 1436892])
Attachments
(1 file)
(deleted),
patch
|
Sylvestre
:
review+
|
Details | Diff | Splinter Review |
Coverity thinks that this line:
https://dxr.mozilla.org/mozilla-central/source/dom/workers/RuntimeService.cpp?q=clampedHardwareConcurrency.compareExchange&redirect_type=single#2565
is useless
It seems that it is the case as the implementation of compareExchange is:
bool compareExchange(T aOldValue, T aNewValue)
{
return Intrinsics::compareExchange(mValue, aOldValue, aNewValue);
}
Would mean that a few lines of code are not doing that they are supposed to.
Assignee | ||
Comment 2•6 years ago
|
||
There is a comment to explain what that block of code does, but let's use Unused to make the static analysis happy.
Assignee: nobody → amarchesini
Flags: needinfo?(amarchesini)
Attachment #8985162 -
Flags: review?(sledru)
Updated•6 years ago
|
Priority: -- → P2
Reporter | ||
Updated•6 years ago
|
Summary: RuntimeService::ClampedHardwareConcurrency() : Calling clampedHardwareConcurrency.compareExchange(0U, clampedValue) is only useful for its return value, which is ignored. [show details] → RuntimeService::ClampedHardwareConcurrency() : Calling clampedHardwareConcurrency.compareExchange(0U, clampedValue) is only useful for its return value, which is ignored.
Reporter | ||
Comment 3•6 years ago
|
||
I saw other similar occurrences, should it be fixed the same way?
https://dxr.mozilla.org/mozilla-central/source/xpcom/threads/nsMemoryPressure.cpp#43
https://dxr.mozilla.org/mozilla-central/source/ipc/glue/BackgroundImpl.cpp#1247
https://dxr.mozilla.org/mozilla-central/source/gfx/gl/GfxTexturesReporter.cpp?q=gfx%2Fgl%2FGfxTexturesReporter.cpp&redirect_type=direct#69
Reporter | ||
Updated•6 years ago
|
Attachment #8985162 -
Flags: review?(sledru) → review+
Pushed by amarchesini@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/231d843c855b
Fix a warning in RuntimeService::ClampedHardwareConcurrency(), r=sylvestre
Comment 5•6 years ago
|
||
bugherder |
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla62
You need to log in
before you can comment on or make changes to this bug.
Description
•