Skip to content

Commit 138f23d

Browse files
committed
io: old StreamerInfo read/write 64 bit collections
1 parent 0ccb835 commit 138f23d

2 files changed

Lines changed: 12 additions & 11 deletions

File tree

io/io/src/TStreamerInfoReadBuffer.cxx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1192,10 +1192,10 @@ Int_t TStreamerInfo::ReadBuffer(TBuffer &b, const T &arr,
11921192
cont = contp[j];
11931193
}
11941194
TVirtualCollectionProxy::TPushPop helper( newProxy, cont );
1195-
Int_t nobjects;
1196-
b >> nobjects;
1197-
env = newProxy->Allocate(nobjects,true);
1198-
if (!nobjects && (vers>=7)) {
1195+
ULong64_t nobjects64 = TStreamerInfoUtils::ReadCollectionSize(b, vers);
1196+
1197+
env = newProxy->Allocate(nobjects64,true);
1198+
if (!nobjects64 && (vers>=7)) {
11991199
// Do nothing but in version 6 of TStreamerInfo and below,
12001200
// we were calling ReadBuffer for empty collection.
12011201
} else {
@@ -1303,7 +1303,7 @@ Int_t TStreamerInfo::ReadBuffer(TBuffer &b, const T &arr,
13031303
for(; obj<end; obj+=objectSize) {
13041304
TVirtualCollectionProxy::TPushPop helper( newProxy, obj );
13051305
ULong64_t nobjects64 = TStreamerInfoUtils::ReadCollectionSize(b, vers);
1306-
R__ASSERT(nobjects64 <= (ULong64_t)std::numeric_limits<Int_t>::max() && "Allocate is not yet 64 bit enabled");
1306+
13071307
void* env = newProxy->Allocate(nobjects64, true);
13081308
if (!nobjects64 && (vers>=7)) {
13091309
// Do nothing but in version 6 of TStreamerInfo and below,

io/io/src/TStreamerInfoWriteBuffer.cxx

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#include "TStreamer.h"
1818
#include "TStreamerElement.h"
1919
#include "TStreamerInfo.h"
20+
#include "TStreamerInfoCollectionUtils.h"
2021
#include "TVirtualCollectionProxy.h"
2122
#include "TRefTable.h"
2223
#include "TFile.h"
@@ -523,9 +524,9 @@ Int_t TStreamerInfo::WriteBufferAux(TBuffer &b, const T &arr,
523524
for(int j=0;j<compinfo[i]->fLength;++j) {
524525
char *cont = contp[j];
525526
TVirtualCollectionProxy::TPushPop helper( proxy, cont );
526-
Int_t nobjects = cont ? proxy->Size() : 0;
527-
b << nobjects;
528-
if (nobjects) {
527+
ULong64_t nobjects64 = cont ? proxy->Size() : 0;
528+
TStreamerInfoUtils::WriteCollectionSize(b, nobjects64);
529+
if (nobjects64) {
529530
auto actions = proxy->GetWriteMemberWiseActions();
530531

531532
char startbuf[TVirtualCollectionProxy::fgIteratorArenaSize];
@@ -587,9 +588,9 @@ Int_t TStreamerInfo::WriteBufferAux(TBuffer &b, const T &arr,
587588

588589
for(Int_t j=0; j<n; j++,obj+=size) {
589590
TVirtualCollectionProxy::TPushPop helper( proxy, obj );
590-
Int_t nobjects = proxy->Size();
591-
b << nobjects;
592-
if (nobjects) {
591+
ULong64_t nobjects64 = proxy->Size();
592+
TStreamerInfoUtils::WriteCollectionSize(b, nobjects64);
593+
if (nobjects64) {
593594
auto actions = proxy->GetWriteMemberWiseActions();
594595

595596
char startbuf[TVirtualCollectionProxy::fgIteratorArenaSize];

0 commit comments

Comments
 (0)