io: Support 64 bits position/byte-count#21183
Open
pcanal wants to merge 12 commits intoroot-project:Arlesiennefrom
Open
io: Support 64 bits position/byte-count#21183pcanal wants to merge 12 commits intoroot-project:Arlesiennefrom
pcanal wants to merge 12 commits intoroot-project:Arlesiennefrom
Conversation
In order to support 64 bits byte count, which does not fit in the space reverse for them in the stream (4 bytes minus 3 control bits) and the position and some byte count do not fit in the variable used in existing code (arguments to WriteVersion, SetByteCount, ReadVersion and CheckByteCount), we need to pass them indirectly. Since the streaming is inherently serial, we can leverage the sequence of calls and cache the 64 bits values in a queue. The bytecount that can not be stored in place in the stream will be held in a collection (fByteCounts) that need to be stored externally to the buffer.
Note to store and restore the larger than 1GB byte count use:
// Copy the content of the const reference.
auto bytecounts{b.GetByteCounts()};
...
b.SetByteCounts(std::move(bytecounts));
Test Results 22 files 22 suites 3d 8h 35m 32s ⏱️ For more details on these failures, see this check. Results for commit a74d03a. |
Contributor
|
The first commit message didn't get reworded, I think. Cf. #20574 (comment) |
jblomer
approved these changes
Feb 7, 2026
| auto full_cntpos = fBufCur - fBuffer; | ||
| fByteCountStack.push_back(full_cntpos); | ||
| *this << (UInt_t)kByteCountMask; // placeholder for byte count | ||
| return full_cntpos < kMaxCountPosition ? full_cntpos : kOverflowPosition; |
Contributor
There was a problem hiding this comment.
Suggested change
| return full_cntpos < kMaxCountPosition ? full_cntpos : kOverflowPosition; | |
| return full_cntpos <= kMaxCountPosition ? full_cntpos : kOverflowPosition; |
|
|
||
| //////////////////////////////////////////////////////////////////////////////// | ||
| /// Read class version from I/O buffer. | ||
| /// If passing startpos and bcnt, CheckByteCount must be called later with |
Contributor
There was a problem hiding this comment.
Is it valid to set only one of them? If not, we can assert both are set or both are nullptr and simplify a bit the logic.
| // support storing more than 1GB in a single TBufferFile. | ||
| const bool bufferLimitedToMaxMapCount = false; | ||
| if (bufferLimitedToMaxMapCount && IsWriting()) { | ||
| if (offset >= kMaxRecordByteCount) { |
Contributor
There was a problem hiding this comment.
Suggested change
| if (offset >= kMaxRecordByteCount) { | |
| if (offset > kMaxRecordByteCount) { |
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.
Continuation/Replacement of #20574 with a new incoming branch name to enable proper testing.