-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ensure our histogram uses a non-zero step
When all allocations are the same size, we were falling back to the size of the smallest allocation as our step for generating histogram buckets. When the smallest allocation was zero bytes, that would lead to a division by zero and an exception. Fix this by falling back to 1 instead of the size of the smallest allocation. This will never lead to a zero division error, and still puts every element in the same bucket because they're all equal (otherwise we wouldn't have needed the fallback). Signed-off-by: Matt Wozniski <[email protected]>
- Loading branch information
Showing
3 changed files
with
25 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Fix the generation of histograms when the tests performed zero-byte allocations. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters