Skip to content
Snippets Groups Projects
Commit 3c7fa4aa authored by Axel Naumann's avatar Axel Naumann
Browse files

Do not duplicate the buffer if using external data.

Copying fBlockList from orig.GetEND() is currect in this case: orig has only one TMemBlock,
and fExternalData->data() and size() will be the same for any reference to that data.
parent 28d71916
No related branches found
No related tags found
No related merge requests found
......@@ -194,8 +194,10 @@ TMemFile::TMemFile(const TMemFile &orig) :
fD = orig.fD; // not really used, so it is okay to have the same value.
fWritable = orig.fWritable;
// We intentionally allocated just one big buffer for this object.
orig.CopyTo(fBlockList.fBuffer,fSize);
if (!fExternalData) {
// We intentionally allocated just one big buffer for this object.
orig.CopyTo(fBlockList.fBuffer,fSize);
}
Init(!NeedsExistingFile(optmode)); // A copy is
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment