Closed
Bug 1131382
Opened 9 years ago
Closed 9 years ago
Compartment stats code uses wrong number of compartments
Categories
(Core :: JavaScript Engine, defect)
Tracking
()
RESOLVED
FIXED
mozilla38
Tracking | Status | |
---|---|---|
firefox38 | --- | fixed |
People
(Reporter: billm, Assigned: billm)
References
Details
Attachments
(1 file)
2.21 KB,
patch
|
luke
:
review+
|
Details | Diff | Splinter Review |
We added some code recently to return some information about compartments in the JS engine. Unfortunately, it relies on rt->numCompartments being the same as the number of compartments you get when you use CompartmentsIter. That turns out not to be true since CompartmentsIter skips over ExclusiveContext compartments.
Attachment #8561771 -
Flags: review?(luke)
Comment 1•9 years ago
|
||
Comment on attachment 8561771 [details] [diff] [review] comp-stats Review of attachment 8561771 [details] [diff] [review]: ----------------------------------------------------------------- ::: js/src/jsapi.cpp @@ +168,5 @@ > > JS_PUBLIC_API(bool) > JS_GetCompartmentStats(JSRuntime *rt, CompartmentStatsVector &stats) > { > + if (!stats.reserve(rt->numCompartments)) Perhaps give a comment explaining the situation for future visitors; or just remove this reserve() since perf doesn't really matter here and you're checking growBy() for failure anyway.
Attachment #8561771 -
Flags: review?(luke) → review+
Assignee | ||
Comment 2•9 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/aa48c1a176c5
Comment 3•9 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/aa48c1a176c5
Assignee: nobody → wmccloskey
Status: NEW → RESOLVED
Closed: 9 years ago
status-firefox38:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla38
You need to log in
before you can comment on or make changes to this bug.
Description
•