Closed Bug 1052248 Opened 6 years ago Closed 6 years ago
Tweak the good
Apologies for the churn in this code, but I came up with a simpler and better formulation of the exceptional cases in goodAllocated(): if the usual |goodCapacity| computation gives us a capacity that is 2/3 or more of the length, we should just increase |goodCapacity| to length. This requires only one special case in goodAllocated(), instead of two. Also, for arrays with more than |EagerAllocationMaxLength| elements that get resized up to their final value, the old code would only right-size them if their length was very close to a power-of-two, whereas the new code will do it for any length. E.g. for length=10000, the old code would resize via the following capacities: 6, 14, 30, ..., 4094, 8190, 16382. The new code does 6, 14, 30, ..., 4094, 10000.
Attachment #8471319 - Flags: review?(bhackett1024) → review+
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla34
You need to log in before you can comment on or make changes to this bug.