Log of /trunk/core/base/src/TBuffer.cxx
Parent Directory
Revision
42425 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Tue Dec 6 20:48:34 2011 UTC (3 years, 1 month ago) by
pcanal
File length: 10981 byte(s)
Diff to
previous 39551
In TBuffer::Expand, when shrinking the buffer do not shrink below the size of the
data already accumulated in the buffer (i. no less than the value of TBuffer::Length()).
In TBranch::SetBasketSize, instead of using the hard minimum of 100, use
100 + the length of the branch name (as 100 is too smalli to hold the
basket's key information for any branch name larger than 30 characters).
This fixes the write past the end of buffer (leading to segfaults)
reported in Savannah: <http://savannah.cern.ch/bugs/?89645>
Revision
39551 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Fri Jun 3 18:37:05 2011 UTC (3 years, 7 months ago) by
pcanal
File length: 10783 byte(s)
Diff to
previous 39548
Add parameter 'copy' to TBuffer::Expand indicating whether the caller
want the existing data to be copy forward (the old behavior and the
new default is to copy the data forward).
Use this feature is TBasket::Reset to avoid a useless memcpy.
Revision
39548 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Thu Jun 2 21:16:27 2011 UTC (3 years, 7 months ago) by
pcanal
File length: 10610 byte(s)
Diff to
previous 36594
Add the function TBuffer::AutoExpand to centralize the automatic
buffer extension policy. This enable the ability to tweak it later
(for example instead of always doubling the size, increasing by
only at most 2Mb or take hints from the number of entries already
in a TBasket).
Revision
36061 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Mon Oct 4 16:05:51 2010 UTC (4 years, 3 months ago) by
pcanal
File length: 9779 byte(s)
Diff to
previous 34198
Introduce an optimized infrastructure for reading objects using a StreamerInfo.
Rather than driving the streaming using a switch statement inside TStreamerInfo::ReadBuffer,
the streaming is now driven using a simple loop over a sequence of configured StreamerInfo actions.
This improves run-time performance by allowing a dramatic reduction in function calls and code
branches at the expense of some code duplication.
There are 3 versions of this loop implemented in TBufferFile and overloaded in TBufferXML and TBufferSQL:
1. virtual Int_t ReadSequence(const TStreamerInfoActions::TActionSequence &sequence, void *object);
2. virtual Int_t ReadSequenceVecPtr(const TStreamerInfoActions::TActionSequence &sequence, void *start_collection, void *end_collection);
3. virtual Int_t ReadSequence(const TStreamerInfoActions::TActionSequence &sequence, void *start_collection, void *end_collection);
The 1st version is optimized to read a single object. The 2nd version is optimized to read the content of TClonesArrays and vectors of pointers to objects.
The 3rd version is used to streamed any collections.
TBufferXML and TBufferSQL overload the loops to introduce extra code to help the buffer keep track of which streamer
element is being streamed (this functionality is not used by TBufferFile.)
A TStreamerInfoActions::TActionSequence is an ordered sequence of configured actions.
A configured action has both an action which is a free standing function and a configuration object deriving
from TStreamerInfoActions::TConfiguration. The configuration contains information that is specific to the action
but varies from use to use, including the offset from the beginning of the object that needs to be updated.
Other examples of configuration include the number of bits requested for storing a Double32_t or its factor and minimum.
When the sequence is intended for a collection, the sequence also has a configuration object deriving
from TStreamerInfoActions::TLoopConfiguration which contains for example the size of the element of
a vector or the pointers to the iterators functions (see below).
Each TStreamerInfo has 2 reading sequences, one for object-wise reading (GetReadObjectWiseActions)
and one for member-wise reading (GetReadMemberWiseActions) which is used when streaming a TClonesArray
of a vector of pointer to the type of objects described by the TClass.
Each collection proxy has at least one reading sequences, one for the reading each version of the
contained class layout.
Each case of the TStreamerInfo::ReadBuffer switch statement is replaced by 4 new action functions,
one for the object wise reading, one for the member wise reading for TClonesArray and vector of pointers,
one for the member wise reading for a vector of object and one for all other collections.
Each collection (proxy) needs to provide 5 new free standing functions:
// Set of functions to iterate easily throught the collection
static const Int_t fgIteratorArenaSize = 16; // greater than sizeof(void*) + sizeof(UInt_t)
typedef void (*CreateIterators_t)(void *collection, void **begin_arena, void **end_arena);
virtual CreateIterators_t GetFunctionCreateIterators(Bool_t read = kTRUE) = 0;
// begin_arena and end_arena should contain the location of a memory arena of size fgIteratorSize.
// If the collection iterator are of that size or less, the iterators will be constructed in place in those location (new with placement)
// Otherwise the iterators will be allocated via a regular new and their address returned by modifying the value of begin_arena and end_arena.
typedef void* (*CopyIterator_t)(void *dest, const void *source);
virtual CopyIterator_t GetFunctionCopyIterator(Bool_t read = kTRUE) = 0;
// Copy the iterator source, into dest. dest should contain the location of a memory arena of size fgIteratorSize.
// If the collection iterator is of that size or less, the iterator will be constructed in place in this location (new with placement)
// Otherwise the iterator will be allocated via a regular new and its address returned by modifying the value of dest.
typedef void* (*Next_t)(void *iter, const void *end);
virtual Next_t GetFunctionNext(Bool_t read = kTRUE) = 0;
// iter and end should be pointers to respectively an iterator to be incremented and the result of collection.end()
// If the iterator has not reached the end of the collection, 'Next' increment the iterator 'iter' and return 0 if
// the iterator reached the end.
// If the end was not reached, 'Next' returns the address of the content pointed to by the iterator before the
// incrementation ; if the collection contains pointers, 'Next' will return the value of the pointer.
typedef void (*DeleteIterator_t)(void *iter);
typedef void (*DeleteTwoIterators_t)(void *begin, void *end);
virtual DeleteIterator_t GetFunctionDeleteIterator(Bool_t read = kTRUE) = 0;
virtual DeleteTwoIterators_t GetFunctionDeleteTwoIterators(Bool_t read = kTRUE) = 0;
// If the size of the iterator is greater than fgIteratorArenaSize, call delete on the addresses,
// Otherwise just call the iterator's destructor.
This functions are currently only 'emulated' using the old infrastructure for the collections other than vector ; they
will later one be provided by the dictionaries.
Revision
27845 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Tue Mar 17 15:23:30 2009 UTC (5 years, 10 months ago) by
pcanal
File length: 8707 byte(s)
Diff to
previous 27750
Improve constness.
In constructor, do not 'tweak' the buffer size in read mode.
In SetBuffer, never expand the buffer in read mode.
Revision
27750 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Tue Mar 10 16:53:33 2009 UTC (5 years, 10 months ago) by
pcanal
File length: 8644 byte(s)
Diff to
previous 27733
Do not resize user provide buffer when the buffer is reading. When writing only resize it when it is smaller then kExtraSpace (i.e. 8 bytes)
Revision
27683 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Tue Mar 3 20:15:49 2009 UTC (5 years, 10 months ago) by
pcanal
File length: 8393 byte(s)
Diff to
previous 22961
Allow user to provide a custom reallocator when the TBuffer is being passed
memory. If the TBuffer does not own the memory __and__ no custom memory
reallocator has been set, a Fatal error will be issued:
Fatal in <TBufferFile::Expand>: Failed to expand the data buffer because TBuffer does not own it and no custom memory reallocator was provided.
This fixes the savannah issues 47611 and 39120
Revision
22961 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Thu Apr 3 13:32:57 2008 UTC (6 years, 9 months ago) by
rdm
File length: 6440 byte(s)
Diff to
previous 21231
move the directories:
base clib cont meta metautils newdelete pcre rint thread unix utils
winnt zip
under the new core meta directory.
Revision
17402 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Fri Jan 19 16:48:00 2007 UTC (8 years ago) by
brun
Original Path:
trunk/base/src/TBuffer.cxx
File length: 7386 byte(s)
Diff to
previous 17306
CVs been changed into a pure abstract interface.
The concrete implementation is in the new class TBufferFile.
All classes previously deriving from TBuffer derive now from TBufferFile, ie
TBuffer <- TBufferFile <- TMessage
<- TBufferXML
<- TBufferSQL
<- TBufferSQL2
Because there are several problems with C++ operators overloading,
The I/O operators are defined in TBuffer. These are inline functions
calling C++ virtual functions defined in TBuffer and overloaded
by TBufferFile and all other derived classes when necessary.
The previous implementation of TBuffer.h included <vector> and Bytes.h.
The two include statements have been moved to TBufferFile.h. As a result the
compilation of the ROOT system is now slightly faster and a big bonus
is that changes in TBufferFile or Bytes.h will affect only TBufferFile
and will not force the recompilation of the entire system.
This change has some side-effects. If you assumed that include <vector>
was done by TBuffer.h, you may have to specify this include directly
in your class. This was the case for a few ROOT classes.
: ----------------------------------------------------------------------
Revision
17306 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Fri Jan 12 16:03:17 2007 UTC (8 years ago) by
brun
Original Path:
trunk/base/src/TBuffer.cxx
File length: 80307 byte(s)
Diff to
previous 17299
TMath::Abs, TMath::Min, TMath::Max, TMath::Sign, TMath::Range
These functions are unfortunately not defined in a standard way in std::
This include is referenced by a new version of TMath.h.
As a result, TMath.h is back compatible with the previous version.
TMathBase.h is used in place of TMath.h in all the classes
that will go into the future miniCore library.
TMath.h and the TMath implementation will go into a new math sub-directory.
TString.h uses TMathBase.h instead of TMath.h.
As a result, it was necessary to include "TMath.h" in some classes
assuming that TMath was included via TString and using other functions
than the ones defined in TMathBase.h
----------------------------------------------------------------------
Revision
14745 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Wed Apr 19 08:22:26 2006 UTC (8 years, 9 months ago) by
rdm
Original Path:
trunk/base/src/TBuffer.cxx
File length: 79844 byte(s)
Diff to
previous 14603
Change the TError.h macros:
Assert -> R__ASSERT
Check -> R__CHECK
Change the TCollection.h macro:
ForEach -> R__FOR_EACH
This to avoid potential problems due too trivial macro names.
The old macros will be removed in the next release. Currently
they will print out warning messages with the advice to move
to the new macro names.
Revision
13465 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Fri Dec 2 22:38:34 2005 UTC (9 years, 1 month ago) by
pcanal
Original Path:
trunk/base/src/TBuffer.cxx
File length: 77414 byte(s)
Diff to
previous 13253
Add TBuffer::StreamObject for TObject* (in addition to the non-TObject version" base/inc/TBuffer.
Also add a comment in ReadFastArray of object, describing a potential work-around
a user code error which is currently disabled because of run-time cost for all other (good) cases.
Revision
11606 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Mon Apr 18 10:54:58 2005 UTC (9 years, 9 months ago) by
brun
Original Path:
trunk/base/src/TBuffer.cxx
File length: 75019 byte(s)
Diff to
previous 11599
Extend the functionality of the Double32_t data type (see below)
This extension supports higher precision than just a 32 bit float
and it also allows better compression when the range and number of bits
are specified.
New functions in TBuffer
void TBuffer::ReadDouble32 (Double_t *d, TStreamerElement *ele)
void TBuffer::WriteDouble32 (Double_t *d, TStreamerElement *ele)
The following functions of TBuffer have new signatures;
Int_t TBuffer::ReadArrayDouble32(Double_t *&d, TStreamerElement *ele)
Int_t TBuffer::ReadStaticArrayDouble32(Double_t *d, TStreamerElement *ele)
void TBuffer::ReadFastArrayDouble32(Double_t *d, Int_t n, TStreamerElement *ele)
void TBuffer::WriteArrayDouble32(const Double_t *d, Int_t n, TStreamerElement *ele)
void TBuffer::WriteFastArrayDouble32(const Double_t *d, Int_t n, TStreamerElement *ele)
The following data members have been added to TStreamerElement;
Double_t fXmin; //Minimum of data member if a range is specified [xmin,xmax,nbits]
Double_t fXmax; //Maximum of data member if a range is specified [xmin,xmax,nbits]
Double_t fFactor; //Conversion factor if a range is specified fFactor = (1<<nbits/(xmax-xmin)
The static function GetRange has been added to TStreamerElement.cxx.
This function analyzes the range specifier given in the data member
comments field.
The following cases are supported for streaming a Double32_t type
depending on the range declaration in the comment field of the data member:
A- Double32_t fNormal;
B- Double32_t fTemperature; //[0,100]
C- Double32_t fCharge; //[-1,1,2]
D- Double32_t fVertex[3]; //[-30,30,10]
E Int_t fNsp;
Double32_t* fPointValue; //[fNsp][0,3]
In case A fNormal is converted from a Double_t to a Float_t
In case B fTemperature is converted to a 32 bit unsigned integer
In case C fCharge is converted to a 2 bits unsigned integer
In case D the array elements of fVertex are converted to an unsigned 10 bits integer
In case E the fNsp elements of array fPointvalue are converted to an unsigned 32 bit integer
Note that the range specifier must follow the dimension specifier.
the case B has more precision (9 to 10 significative digits than case A (6 to 7 digits).
The range specifier has the general format: [xmin,xmax] or [xmin,xmax,nbits]
[0,1]
[-10,100];
[-pi,pi], [-pi/2,pi/4],[-2pi,2*pi]
[-10,100,16]
if nbits is not specified, or nbits <2 or nbits>32 it is set to 32
TStreamerInfo has been modified to take into account the new facility
when streaming a Double32_t. It calls the new TBuffer functions ReadDouble32
and WriteDouble32 instead of the previous inline code.
Note that the files TEmulatedCollectionProxy.cxx and TGenCollectionStreamer.cxx
must still be modified to pass correctly the TStreamerElement object
to the Double32 conversion routines (for Philippe).
Note also that the class TXMLBuffer must still be changed to support
the Double32_t data type (for Sergei).
The test program Event has been modified to illustrate several combinations
of the range specifier.
The test program stress2 has been changed to take into account the slight
increase in the file size due to the new members in TStreamerElement.
Revision
11408 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Tue Mar 22 17:10:25 2005 UTC (9 years, 10 months ago) by
brun
Original Path:
trunk/base/src/TBuffer.cxx
File length: 71726 byte(s)
Diff to
previous 11258
From Philippe:
The schema evolution for foreign class in ROOT 3.10.02 was requiring
the user to set its own class version (via RootClassVersion).
In ROOT 4.00 we introduce a checksum to remove the need for the user
supplied class version for foreign class.
However the auto-discovery of the proper TStreamerInfo base on
the checksum was __only__ enabled by file written by ROOT 4.00.00
and above.
This patch includes code to enabled this auto-discovery (when
needed) for older files.
Revision
11243 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Sat Mar 5 22:15:52 2005 UTC (9 years, 10 months ago) by
brun
Original Path:
trunk/base/src/TBuffer.cxx
File length: 69492 byte(s)
Diff to
previous 10728
Fix a potentially dangerous bomb for the future in TBuffer.h.
The enum kIsOwner (protected) and kStreamedMemberWise (public)
were both set to BIT(14) !!
I moved kIsOwner to public and set it to BIT(15) because
kStreamedMemberWise is already used for forward compatibility.
I added 3 user bits enum kUser1, kUser2, kUser3.
These bits can be used by the application to mark special cases when streaming.
For example, kUser3 is used by TCanvas::Streamer to avoid writing
twice the table of colors in case two or more canvases are streamed
to the same buffer (case seen by Marek in PROOF).
~
~
Revision
10728 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Thu Dec 9 07:14:03 2004 UTC (10 years, 1 month ago) by
brun
Original Path:
trunk/base/src/TBuffer.cxx
File length: 69406 byte(s)
Diff to
previous 10541
From Sergei Linev
Add new method TBuffer::SkipObjectAny.
This new method reads the byte count for any object and jumps
to the data following this object. This new function facilitates
support for schema evolution with XML.
Revision
10541 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Wed Nov 17 06:02:52 2004 UTC (10 years, 2 months ago) by
brun
Original Path:
trunk/base/src/TBuffer.cxx
File length: 69139 byte(s)
Diff to
previous 10350
From Philippe:
This patch implements the schema evolution to and from selected containers.
The following cases are currently implemented:
TClonesArray object -> STL object containing the same type
TClonesArray pointer -> STL pointer containing the same type
STL object -> STL object containing the same type
STL pointer -> STL pointer containing the same type
STL split branches -> TClonesArray
In addition this patch implement the ability to have schema evolution
between various version of a foreign class when the library is not present.
This patch also support in in TTree::Draw for the schema evolution of simple
type stored in a non-split branch.
Revision
10350 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Tue Oct 19 11:00:09 2004 UTC (10 years, 3 months ago) by
brun
Original Path:
trunk/base/src/TBuffer.cxx
File length: 68532 byte(s)
Diff to
previous 9288
From Philippe:
implements MemberWise streaming for collection with a
TVirtualCollectionProxy and whose content is splittable (i.e. guaranteed
homogeneous).
In this first implementation, objectwise streaming is still the default.
To activate memberwise streaming, call the static function
TStreamerInfo::SetStreamMemberWise(kTRUE);
Revision
8843 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Mon May 10 12:08:37 2004 UTC (10 years, 8 months ago) by
brun
Original Path:
trunk/base/src/TBuffer.cxx
File length: 67059 byte(s)
Diff to
previous 8505
Improve constness of several functions
void WriteObject(const void *actualObjStart, const TClass *actualClass);
void MapObject(const void *obj, const TClass *cl, UInt_t offset = 1);
Version_t ReadVersion(UInt_t *start = 0, UInt_t *bcnt = 0, const TClass *cl = 0);
Int_t WriteObjectAny(const void *obj, const TClass *ptrClass);
void ReadFastArray(void *start , const TClass *cl, Int_t n=1, TMemberStreamer *s=0);
void ReadFastArray(void **startp, const TClass *cl, Int_t n=1, Bool_t isPreAlloc=kFALSE, TMemberStr
void WriteFastArray(void *start, const TClass *cl, Int_t n=1, TMemberStreamer *s=0);
Int_t WriteFastArray(void **startp, const TClass *cl, Int_t n=1, Bool_t isPreAlloc=kFALSE, TMemberSt
void StreamObject(void *obj, const TClass *cl);
Revision
7921 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Fri Jan 16 16:27:36 2004 UTC (11 years ago) by
brun
Original Path:
trunk/base/src/TBuffer.cxx
File length: 66710 byte(s)
Diff to
previous 7880
From Philippe:
TBuffer.cxx : use checksum only if the class version
is set to the default (1) and the class does not have a
Streamer method (IsForeign()==true)
TFormula.cxx: fix a typo
TClass.cxx: add comment to explicitly the mean of the bits use
by TClass::Property
TStreamerInfo.cxx: fix problem in the conversion from Double32_t,
use newType in GetValue. Fix a recursion problem in TStreamerInfo::Build.
Revision
7880 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Sat Jan 10 10:52:31 2004 UTC (11 years ago) by
brun
Original Path:
trunk/base/src/TBuffer.cxx
File length: 66696 byte(s)
Diff to
previous 7828
From Philippe:
This mega patch introduces a new implementation of the STL I/O
which is backward and forward compatible. In addition this is more
exactly a new implementation or an extension of the container I/O.
We are introducing a new abstract interface:
"TVirtualContainerProxy", which can be implemented to present a
proxy to any collection which the I/O (and TTreeFormula) can use
then transparently.
The TVirtualContainerProxy interface allows to the I/O system to
request some information and to execute some essential function of
the container:
what kind of object/data does it contain
does it contain pointers
how to insert data into the container
how to retrieve an array of pointer to the elements inside
how to create a collection object
how to clear the collection
how to resize the collection
how to streamer the collection (if needed)
how to calculate the sizeof the collection
how to calculate the number of elements of the collection.
Using those primitives, the I/O and TTreeFormula should be able to
access any collection. The I/O should also be able to handle the
splitting of collections that can be split (i.e. contains a single
type of object/data).
The current compromise selected between code duplication,
performance of the I/O of TClonesArray and vector of pointers and
the performance of the I/O of other containers, was to have on
function handle all collection as if they were a C-style array of
pointers to data. This implies for example that the I/O of vector
of object current passes via the construction of temporary array
of pointer. The cost of this construction is usually ~Qjust~R the
cost of calculating the addresses of the elements and assigning it
to an array element.
Registering a collection proxy will be similar to
static int dummy = GenerateInitInstance((CollectType*)0x0)-
>AdoptCollectionProxy(new CollectTypeProxy));
Follows a few details on the modifications made to some of the
files and classes.
Bytes.h:
Work around a problem in the MSVC++ 6.0 optimizer. This should
not affect other compilers.
String:
Included the std::string dictionary into G__Base2.cxx, this
insures its presence at all time.
Added a new file string.cxx holding the streamer for
std::string.
RConfig.h
Added proper ansi stream configuration for AIX, KCC
Added template specialization defect for MSVC
TBrowser
Start adding the ability to browser non TObject classes
TBuffer
To handle the reading and writing array of objects, added:
Int_t CheckByteCount(UInt_t startpos, UInt_t bcnt, const
TClass *clss, const char* classname);
Int_t CheckByteCount(UInt_t startpos, UInt_t bcnt, const
char *classname);
void ReadFastArray(void *start , TClass *cl, Int_t n=1,
TMemberStreamer *s=0);
void ReadFastArray(void **startp, TClass *cl, Int_t n=1,
Bool_t isPreAlloc=kFALSE, TMemberStreamer *s=0);
void WriteFastArray(void *start, TClass *cl, Int_t n=1,
TMemberStreamer *s=0);
Int_t WriteFastArray(void **startp, TClass *cl, Int_t n=1,
Bool_t isPreAlloc=kFALSE, TMemberStreamer *s=0);
TROOT
Enhancement to make the access to gROOT not dependent for the
library loading order. In particular we added:
ROOT::GetROOT()
which should be used instead of gROOT.
Improve support for STL. In particular, now STL containers do
have a corresponding TClass object
TRealData
Replace SetStreamer by AdoptStreamer that allow to use not only
a streamer function but also streamer object (allowing streamer
with a state for Foreign classes)
TString:
Improve streamer performance
TSystem:
More consistency of the return value of TSystem::CompileMacro
build/unix/makecintdlls.sh
Stop making the string.dll
config:
enhance sgicc makefiles
cont:
fix TBits::operator=
TClassTable now warns for duplicate only for non stl classes
TClonesArray fix a typo
gpad:
Add a new class TInspectObject to enable inspect non TObject
classes
TRootBrowser : enable inspect non TObject classes
TFormula/TTreeFormula
To enhance performance switch from using one array fOper which
contained the operation code and its arguments to using 2 arrays
fActions and fActionParams to store respectively the operation and
its parameters.
A new function Convert is used to convert old version from the
fOper to fActions. This allows cleaner coding and offer
optimization opportunities.
TTreePlayer
Start adding support in MakeClass for STL containers.
TRint/TProofServ
Insure the loading of the string support
Event.cxx
make sure to avoid memory over-write
stress.cxx
Add new parameters
stress <nevent> <style> <subbench> <portion>
if <subbench> is 1 or higher, print the benchmark results after
each test. This allows understand
which test is affect by a performance change.
portion is a binary field to indicate which test to run. This
allows to focus on a particular test.
TVirtualCollectionProxy
Abstract interface used to access any type of containers from
the I/O system and TTreeFormula. See TVectorProxy and
TEmulatedVectorProxy for examples.
TEmulatedVectorProxy
Implementation of a std::vector proxy to be able to read a
std::vector without any libraries.
TVectorProxy
Implementation of TVirtualCollectionProxy for a std::vector for
which we have the library.
TStreamerInfo.cxx
Split in 3 files: TStreamerInfo.cxx
TStreamerInfoReadBuffer.cxx TStreamerInfoWriteBuffer.cxx
All the ReadBuffer, ReadBufferClones and the new ReadBufferSTL
(similarly for WriteBuffer) have been factorized into one
function and 2 short wrappers. The new main function expect an
array of pointer to the objects (this array is most often of size
one).
TClonesArray objects pass GetObjectRef(0) to the common
ReadBuffer
vector<bla*> v pass &(v[0])
vector<bla> needs to create an intermediary array to hold the
address
This mechanism is sometimes not optimal (vector<blah>) but
allows extremely flexibly and extension. Basically, to add
support for a new container type using the StreamerInfo mechanism
(in particular allows splitting), one 'just' need to implement a
TVirtualCollectionProxy, which, in particular, will return an
array of address to the object it contains. Even std::map can be
handled with this mechanism, since, for I/O purposes, it can be
consider as a container of pairs.
Add a few optimization, including more caching via a new array
of a new struct (fComp).
Fixed a problem (re)introduced while implementing the Foreign
class CheckSum. Doing:
class Event;
f = new TFile("Event.root");
resulted in errors.
TCint
Add proper support for TClass of STL containers. Fix a memory
leak.
Add support for load TClass via a typedef.
Fix a problem with multiple inheritance
TClass
Fixed a problem (re)introduced while implementing the Foreign
class CheckSum. Doing:
class Event;
f = new TFile("Event.root");
resulted in errors.
Add a
TClass/TGenericClassInfo/TDataMember
Add support for a new interface (TVirtualCollectionProxy)
useable for STL containers or any user defined containers.
Add support for streamer with are objects (as opposed to free
standing function or methods). This allows the user a greater
flexibility in writing a streamer.
Add a few optimizations
Add CanSplit to answer the question for a whole Class (for
example some collection can not be splitted).
TClassStreamer
New class to wrap a class wide streamer
ClassStreamerFunc_t
typedef for a class wide streamer function
TMemberStreamer
New class to wrap a specific class member streamer
MemberStreamerFunc_t
typedef for a specific class member streamer function
RootStreamer
Macro to specify a free standing streamer object or function
for a class
For example:
RootStreamer(string,std_string_streamer);
TStreamerElement:
A couple of optimization/simplification.
Add support for the new STL I/O
Extend the useful
TBranchElement:
add a connection to the proper TVirtualCollectionProxy
add support for STL containers (non-split and split mode)
TTree
Make the function TTree::GetMakeClass NON-virtual for better
efficiency
Add support for STL containers
TBasket
Left (in comment) a yet unproved improvement proposed by
Victor. The preliminary tests were inconclusive performance wise
and it had (seemingly) problem with backward and forward
compatibility.
TBranch
Performance improvements
metautils
This is a new package for C++ files shared between rootcint and
meta.
It contains TClassEdit a class to help determine some property
of a class given its class name (stl, template, etc).
utils
Introduced a new file RStl.cxx to start separating rootcint in
modules.
Modified rootcint to support the new STL I/O methods.
In particular a new class RStl is in charge of doing the
generating of code for STL containers.
Revision
7828 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Sat Jan 3 09:41:16 2004 UTC (11 years ago) by
brun
Original Path:
trunk/base/src/TBuffer.cxx
File length: 61409 byte(s)
Diff to
previous 7799
Add the following new functions:
Int_t ReadArrayDouble32(Double_t *&d);
Int_t ReadStaticArrayDouble32(Double_t *d);
void ReadFastArrayDouble32(Double_t *d, Int_t n);
void WriteArrayDouble32(const Double_t *d, Int_t n);
void WriteFastArrayDouble32(const Double_t *d, Int_t n);
Revision
7799 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Thu Dec 25 17:47:02 2003 UTC (11 years, 1 month ago) by
brun
Original Path:
trunk/base/src/TBuffer.cxx
File length: 59096 byte(s)
Diff to
previous 6926
Add an optional argument to TBuffer::ReadVersion.
The new argument "TClass* cl) is used to retrieve the version number
corresponding to the class checksum.
This change is required to support automatic schema evolution
for foreign classes.
Revision
6924 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Mon Jul 14 17:14:49 2003 UTC (11 years, 6 months ago) by
brun
Original Path:
trunk/base/src/TBuffer.cxx
File length: 58396 byte(s)
Diff to
previous 6897
From Philippe;
This patch improves the error recovery in the case where TBuffer::ReadObjectAny decides it wont be able
to read/load the objects. By calling CheckByCount explicitly we prevent an extra spurrious error
message of the style 'some top level class Streamer is out of sync'.
Revision
6897 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Fri Jul 11 15:04:03 2003 UTC (11 years, 6 months ago) by
brun
Original Path:
trunk/base/src/TBuffer.cxx
File length: 58006 byte(s)
Diff to
previous 6783
Protection added in TBuffer::ReadObjectAny in case a fakeclass derives from a compiled class
or vice-versa.
The typical case is when reading a data structure containing a class
for which the shared lib is missing.
Revision
6783 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Wed Jun 25 15:35:09 2003 UTC (11 years, 7 months ago) by
brun
Original Path:
trunk/base/src/TBuffer.cxx
File length: 57860 byte(s)
Diff to
previous 6705
From Philippe:
This patch introduces TClass::HasDefaultConstructor which return true if a default constructor is available through fNew OR through the interpreter. This will avoid an erroneous message when the class dictionary has
not been generated by rootcint.
Revision
6705 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Wed Jun 11 16:57:45 2003 UTC (11 years, 7 months ago) by
brun
Original Path:
trunk/base/src/TBuffer.cxx
File length: 57844 byte(s)
Diff to
previous 6584
In TBuffer::ReadObjectAny return a null pointer when reaching the error case"
"ReadObject", "got object of wrong class"
This improve the error recovery when reading an object deeply nested in a collection.
Revision
6421 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Fri Apr 11 11:48:11 2003 UTC (11 years, 9 months ago) by
rdm
Original Path:
trunk/base/src/TBuffer.cxx
File length: 57590 byte(s)
Diff to
previous 6416
Big (unsigned) long long support patch. Following provided:
- basic typedefs in Rtypes.h: Long64_t and ULong64_t
- basic Long64 I/O support in TBuffer
- automatic Long64 I/O support in TStreamerInfo
- Long64 byteswap in Bytes.h
- Long64 type handling in classes like TDataMember, TDataType, TCint,
TROOT, etc
- Removal of obsolete Long64_t typedefs in many PROOF classes
No changes for non-Long64 data types (no backward incompatibilies).
I/O tested for Long64 basic type, and static and dynamic arrays using
handcoded streamers, rootcint generated streamers and automatic StreamerInfo
streamers.
Revision
6416 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Thu Apr 10 15:25:25 2003 UTC (11 years, 9 months ago) by
brun
Original Path:
trunk/base/src/TBuffer.cxx
File length: 55430 byte(s)
Diff to
previous 6295
From Philippe:
The following patch protects CheckByteCount against a very corrupted byte count.
If the byte count was to push the buffer beyond its end, an error message is printed
and the buffer is set to exactly its end position.
Revision
6295 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Tue Mar 11 14:27:15 2003 UTC (11 years, 10 months ago) by
rdm
Original Path:
trunk/base/src/TBuffer.cxx
File length: 55103 byte(s)
Diff to
previous 6184
fix in writing negative Long_t's, the unsused 4 bytes must be set to -1
and not 0 to be able to read on 64 bit machines at least up to 4 byte
negative longs. Without this fix -1 written on 32 bit was read as 4294967295
on a 64 bit machine.
Revision
6055 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Tue Feb 4 22:04:17 2003 UTC (11 years, 11 months ago) by
brun
Original Path:
trunk/base/src/TBuffer.cxx
File length: 53970 byte(s)
Diff to
previous 5930
From Philippe:
The following patch insures that object of class using multiple inheritance with TObject not being in the
'left-most' inheritance part are now correctly returned even when they are saved multiple time in the same
buffer (the class information for these objects are stored only once, and was not available during the 2nd
reading).
Revision
5739 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Wed Dec 4 14:35:13 2002 UTC (12 years, 1 month ago) by
rdm
Original Path:
trunk/base/src/TBuffer.cxx
File length: 52375 byte(s)
Diff to
previous 5717
fix in explicit template instantiation syntax which was wrong, but accepted
by gcc and icc (!). Remove TObjPtr class which is now just an instantiation
of TObjNum<void*> (for backward compatability we provide the typedef:
typedef TObjNum<void*> TObjPtr;). Remove reference to TObjPtr.h from
TBuffer.cxx. To compile make sure to remove base/src/G__Base1.d,
base/src/G__Base2.d, base/src/G__Base3.d and base/src/TBuffer.d.
Revision
5717 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Mon Dec 2 18:50:12 2002 UTC (12 years, 1 month ago) by
rdm
Original Path:
trunk/base/src/TBuffer.cxx
File length: 52397 byte(s)
Diff to
previous 5600
mega patch to remove almost all compiler warnings on MacOS X where the
compiler is by default in pedantic mode (LHCb also like to use this option).
The following issues have been fixed:
- removal of unused arguments
- comparison between signed and unsigned integers
- not calling of base class copy ctor in copy ctor's
To be done, the TGeo classes where we get still many hundred warnings of
the above nature. List forwarded to Andrei.
Revision
5560 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Mon Nov 11 11:27:47 2002 UTC (12 years, 2 months ago) by
brun
Original Path:
trunk/base/src/TBuffer.cxx
File length: 52509 byte(s)
Diff to
previous 5524
This patch enhances speed by avoid the use of the interpreter to access
constructors and destructor. It also allows for feeding a way to access
the constructor and destructor independently of the dictionary.
5 new data members were added to TGenericClassInfo/TClass.
Those are direct wrapper around
- default constructor
- array constructor
- delete
- delete []
- destructor
In TKey::TKey and TBuffer::WriteObjectAny, a new message was added:
Warning in <TKey::TKey>: Since TSocket had no public constructor
which can be called without argument, TSocket objects can not be read
with the current library. You would need to add a default constructor
before attempting to read.
Philippe.
Revision
5523 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Fri Nov 1 19:12:10 2002 UTC (12 years, 2 months ago) by
brun
Original Path:
trunk/base/src/TBuffer.cxx
File length: 51983 byte(s)
Diff to
previous 5363
From Philippe:
This patch adds the ability to save objects of classes using multiple
inheritance (directly or indirectly) as part of other objects.
(Previously multiple inheritance was only supported for top level objects).
In TBuffer.h, TBuffer.cxx:
TBuffer::WriteObject( const void *actualObjStart, TClass *actualClass);
has been made protected. It is replaced by
WriteObjectAny(const void *obj, TClass *ptrClass);
which has a slightly different semantic (for multiple inheriting classes).
The value of 'obj' in expected to be a value that can be legally stored
in a pointer to an object of the type described by 'ptrClass'. I.e:
MyClass *ptr;
....
b.WriteObjectAny(ptr,gROOT->GetClass(typeid(MyClass)));
We introduced:
void *ReadObjectAny(const TClass* cast);
which returns a value suitable to be stored in a pointer to an object of
the type described by 'cast'. I.e, a typical usage is:
MyClass *ptr = (MyClass*)b.ReadObjectAny(MyClass::Class());
The existing function
TObject *TBuffer::ReadObject(const TClass *clReq)
now ignores its parameter and returns the address where the object read
actually start. It should be noted that if the object is of a class
which derives from TObject but not as a first inheritance, this value is
NOT a valid TObject*. We recommend using ReadObjectAny instead.
In TKey.cxx, I reverted the comments to properly describe how to deal with
top level object which inherits from TObject but not as a first inheritance
(can not use dynamic_cast).
In TGenericInfo.h, TGenericInfo.cxx, rootcint.cxx and TClass.cxx, we moved
to always use an IsA wrapper function instead of using the interpreter for
TObjects.
TClass.cxx has been modified to optimize a few function now called many
times.
TStreamerInfo.cxx and TStreamerElement.cxx has been modified to use the
new TBuffer function and to properly read/write multiple inheriting objects.
Revision
5363 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Mon Sep 30 09:18:53 2002 UTC (12 years, 3 months ago) by
brun
Original Path:
trunk/base/src/TBuffer.cxx
File length: 49876 byte(s)
Diff to
previous 4975
In the inline definition of the output operator << replace the call to
buf.WriteObject(obj)
by
buf.WriteObject(obj, cl)
In TBuffer::ReadObject and TBuffer::WriteObject, replace calls to
StreamObject(obj,clRef)
by
clRef->Streamer(obj, *this);
With these corrections, one gain two levels of recursivity when
streaming TObject*. It makes I/O faster and may help on MACOSX
where the maximum recursivity level in the calling stack seems
to be limited.
Revision
4736 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Tue Jun 18 07:00:33 2002 UTC (12 years, 7 months ago) by
brun
Original Path:
trunk/base/src/TBuffer.cxx
File length: 49830 byte(s)
Diff to
previous 4666
From Philippe:
The following patch corrects the behavior in the following cases:
Multiple-inheritance from TObject (especially with TObject NOT the first base class).
Using operator>> on class not inheriting from TObject but still instrumented.
Revision
4656 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Tue Jun 4 07:29:13 2002 UTC (12 years, 7 months ago) by
brun
Original Path:
trunk/base/src/TBuffer.cxx
File length: 50849 byte(s)
Diff to
previous 4498
Improvements by Victor Perevoztchikov
1. rootcint generates all codes for STL containers and arrays of containers.
Now arrays of containers implemented for all STL types, before was only
for vector and deque. It works for both, pointers and objects inside of
containers.
rootcint was simplified, now containers and arrays of ones generated by
one routine.
Special routine StreamerElement provides the code for different types.
So everything located in one place and easy to maintain. It is easy to
expand for all other code generators.
2.Some small addings to TBuffer, just to avoid direct use of gROOT->GetClass
Improvements in rootcint by Mathieu de Naurois in case of namespaces
Revision
4498 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Thu May 9 20:22:01 2002 UTC (12 years, 8 months ago) by
brun
Original Path:
trunk/base/src/TBuffer.cxx
File length: 49524 byte(s)
Diff to
previous 4460
New attempt to introduce the new additions (Philippe) to the I/O system
as well as as the new version of ClassDef/ClassImp.
With the additions to the I/O, it is now possible to generate
a dictionary for classes not instrumented with ClassDef.
Revision
4446 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Fri May 3 14:30:43 2002 UTC (12 years, 8 months ago) by
brun
Original Path:
trunk/base/src/TBuffer.cxx
File length: 49523 byte(s)
Diff to
previous 4177
Introduce a long patch by Philippe. With this patch, ROOT I/O
should be able to support foreign not-ROOT instrumented classes.
More information will come later.
This patch is tentatively put in the CVS head to facilitate
testing on all platforms.
Revision
3844 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Sun Feb 3 16:13:27 2002 UTC (12 years, 11 months ago) by
brun
Original Path:
trunk/base/src/TBuffer.cxx
File length: 44605 byte(s)
Diff to
previous 3840
Replace the union
union {
TExMap *fReadMap; //Map containing id,object references during reading
TExMap *fWriteMap; //Map containing object,id pairs during writing
};
by
TExMap *fMap; //Map containing object,id pairs for reading/ writing
The union was an unnecessary complication and also given problems
with rootcint when another pointer (eg fParent) was added to the class.
New constructors added:
TBuffer(EMode mode);
TBuffer(EMode mode, Int_t bufsiz);
TBuffer(EMode mode, Int_t bufsiz, void *buf, Bool_t adopt = kTRUE);
The Get/SetParent moved to the implementation file.
Revision
3836 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Sat Feb 2 11:52:46 2002 UTC (12 years, 11 months ago) by
brun
Original Path:
trunk/base/src/TBuffer.cxx
File length: 43788 byte(s)
Diff to
previous 3335
Add new member
TObject *fParent; //fParent points to the buffer owner (typically a TFile).
Add new functions
TObject *Getparent()
void SetParent(TObject *parent);
The fParent info will be used instead of gFile in all the places currently
referencing gFile and reading/writing from/to a TBuffer.
Revision
3334 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Fri Nov 30 11:29:37 2001 UTC (13 years, 1 month ago) by
rdm
Original Path:
trunk/base/src/TBuffer.cxx
File length: 43647 byte(s)
Diff to
previous 3224
new argument "adopt" to TBuffer ctor and to SetBuffer(). The default
value of the argument is kTRUE. When this value is kFALSE the buffer
passed will not be adopted by TBuffer and not deleted in the dtor
or in SetBuffer() when a new buffer is passed in. The default value
of adopt is backward compatible.
Revision
2080 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Fri Apr 27 06:55:57 2001 UTC (13 years, 9 months ago) by
brun
Original Path:
trunk/base/src/TBuffer.cxx
File length: 42869 byte(s)
Diff to
previous 1982
n TBuffer::ReadObject add support for the case when reading a fake class.
In this case, instead of calling Streamer (missing by definition), the function
calls the class::ReadBuffer instead. When this happens, a Warning is printed
just in case the call to ReadBuffer may be wrong if the class was wriiten
by a custom Streamer.
Revision
1837 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Wed Mar 21 09:28:01 2001 UTC (13 years, 10 months ago) by
brun
Original Path:
trunk/base/src/TBuffer.cxx
File length: 42224 byte(s)
Diff to
previous 1786
Files written with versions older than 3.00/06 had a non-portable
implementation of Long_t/ULong_t. These types should not have been used at all.
However, because some users had already written many files with these types
we provide a fix to be able to read old files.
The inline operator >> for Long_t has been moved to TBuffer.cxx.
A new function frombufOld local to TBuffer is called to read Long_t types
from buffers in files written before 3.00/06.
Revision
1778 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Fri Mar 9 08:45:09 2001 UTC (13 years, 10 months ago) by
brun
Original Path:
trunk/base/src/TBuffer.cxx
File length: 41122 byte(s)
Diff to
previous 1503
Modify the conversion functions for Long_t/ULong_t data types to make these types
portable data types. 8 bytes are always written/read to/from the buffer.
In case the type was written on a machine where sizeof(Long-t) is 8 bytes
and read on a machine where sizeof(Long-t) is 4 bytes, only the 4 least significant bytes
are considered. In the inverse situation the conversion is always correct.
The change will allow a smooth and back compatible introduction of Long_t = longlong
on machines where this is possible.
This form allows you to request diffs between any two revisions of this file.
For each of the two "sides" of the diff,
enter a numeric revision.