-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The use of `MaybeUninit` was invalid in `quantum_matches`, `partial_cmp`, `total_cmp`. The underlying decNumber library was *not* guaranteed to zero-initialize the entire `Decimal` struct--in particular it would often leave unneeded bytes in `lsu` uninitialized--but Rust requires that the entire struct be initialized before calling `assume_init`. So just zero initialize in Rust and avoid `MaybeUninit` entirely. Note that we do think that the use of `MaybeUninit` to avoid zero-initializing the entire string formatting buffer in the `fmt::Display` impls was valid, but to avoid a false positive with @icmccorm's automatic verification tool, we're switching to zero initialization there as well. The performance hit should be negligible, and we can always switch back to `MaybeUninit` there in the future if it becomes important.
- Loading branch information
Showing
6 changed files
with
37 additions
and
23 deletions.
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
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
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
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