Conversation
In Tarsnap 1.0.15 (November 2008) code was added to switch into a quasi-lowmem mode if it finds that a lot of memory is being used to cache small files. Adjust that behaviour to only kick in for files which are < 10 MB in size; larger files will be fully cached (unless --lowmem or --verylowmem are specified explicitly) so they don't need to be re-read on every run. Reported by: Tim Bishop
gperciva
reviewed
Jul 31, 2025
|
|
||
| /* | ||
| * Decide if we want to keep a trailer: We follow the policy provided | ||
| * by the caller (record a trailer unless notrailer != 0) unless we're |
Member
There was a problem hiding this comment.
I was a bit confused by the "unless notrailer != 0" bit in the comment, since that's not part of this "paragraph". If we already have notrailer = 1, then that only applies below on line 567.
For clarity, I'd be tempted to put lines 561-563 inside an
if (notrailer == 0) {
}
OTOH, you might take the view that anybody reading this section should be able to figure it out, so shrug.
Member
Author
There was a problem hiding this comment.
Yeah, I agree it's not the clearest code but I don't want to complicate things by adding another conditional either. I think this is fine.
Member
Author
|
BTW this doesn't actually fix Tim's issue; what he was running into was the |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In Tarsnap 1.0.15 (November 2008) code was added to switch into a quasi-lowmem mode if it finds that a lot of memory is being used to cache small files.
Adjust that behaviour to only kick in for files which are < 10 MB in size; larger files will be fully cached (unless --lowmem or --verylowmem are specified explicitly) so they don't need to be re-read on every run.
Reported by: Tim Bishop