Closed
Bug 1689140
Opened 4 years ago
Closed 4 years ago
SliceBudget::counter has smaller range than WorkBudget::budget on 32-bit platforms
Categories
(Core :: JavaScript: GC, defect)
Core
JavaScript: GC
Tracking
()
RESOLVED
FIXED
87 Branch
Tracking | Status | |
---|---|---|
firefox87 | --- | fixed |
People
(Reporter: jonco, Assigned: jonco)
References
Details
Attachments
(1 file)
When we create a SliceBudget based on a WorkBudget, we assign counter from the budget:
https://searchfox.org/mozilla-central/source/js/src/gc/GC.cpp#3004
Unfortunately, counter is a intptr_t and budget is int64_t, so there is the potential for this to go wrong.
Work budgets are mainly used for testing (e.g. in zeal modes) and any sensible budget will fit in 32 bits so it's unlikely this is causing a problem.
Assignee | ||
Comment 1•4 years ago
|
||
This patch does several things:
- make the counter type int64_t like the work budget parameter (the original purpose of this bug)
- simplify implementation by using a Variant to discriminate between different kinds of budget
- remove the global initialization
- remove makeUnlimited() (and replace uses with assignment from SliceBudget::unlimited())
- add convenience methods to get the original budget parameters
- add basic API tests
The use of Variant had the consequence that we now have to pass SliceBudget by reference now to make the linter happy.
Updated•4 years ago
|
Assignee: nobody → jcoppeard
Status: NEW → ASSIGNED
Pushed by jcoppeard@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/57cfe8a49a44
Refactor SliceBudget API r=sfink
Comment 3•4 years ago
|
||
bugherder |
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
status-firefox87:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → 87 Branch
You need to log in
before you can comment on or make changes to this bug.
Description
•