-
Notifications
You must be signed in to change notification settings - Fork 480
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sstable: always use target buffer for CompressAndChecksum
Currently `CompressAndChecksum` can alias the original data buffer if we do not compress the data (either because compression is disabled, or the data was not compressible enough). In most cases, we write out the resulting data which can mangle the buffer. This leads most callers to check if the buffer is not compressed and make a copy. This change moves the copy into `CompressAndChecksum`; we always use the dst buffer, even if we don't compress. This simplifies the callers and makes things less fragile.
- Loading branch information
1 parent
310fac7
commit e02e7e0
Showing
4 changed files
with
22 additions
and
82 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