[root] / trunk / core / base / src / TRef.cxx Repository:
ViewVC logotype

Log of /trunk/core/base/src/TRef.cxx

Parent Directory Parent Directory


Links to HEAD: (view) (download) (as text) (annotate)
Sticky Revision:

Revision 48798 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Mar 1 21:04:47 2013 UTC (22 months, 3 weeks ago) by pcanal
File length: 19662 byte(s)
Diff to previous 43279
Import revision 48797 from the v5-34-00 patch branch:
Avoid silent failure when reaching the maximum amount of TRef.  When a
TProcessID is full (has seen 16777215 objects), we switch to new one TProcessID
(maximum 65535 including the TProcessIDs read from file).  TRefArray can not
switch to new TProcessID if they already contain objects.

Some of the new warning/errors:

Warning in <TRefArray::AddAtAndExpand>: The ProcessID for the 0x5f83819e8 has been switched to ProcessID4/6c89f37e-8259-11e2-9717-166ee183beef:4

Error in <TRefArray::AddAtAndExpand>: The object at %p can not be registered in the process the TRefArray points to (pid = ProcessID4/6c89f37e-8259-11e2-9717-166ee183beef) because the ProcessID has too many objects and the TRefArray already contains other objecs.


Warning in <TProcessID::AddProcessID>: Maximum number of TProcessID (65535) is almost reached (one left).  TRef will stop being functional when the limit is reached.
....
Fatal in <TProcessID::AddProcessID>: Maximum number of TProcessID (65535) has been reached.  TRef are not longer functional.

Revision 43279 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed Mar 7 19:02:45 2012 UTC (2 years, 10 months ago) by pcanal
File length: 19542 byte(s)
Diff to previous 37963
Coverity number #36369,36368
about unsafe (self) assignment operator

Revision 37963 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu Feb 3 11:01:12 2011 UTC (3 years, 11 months ago) by rdm
File length: 19505 byte(s)
Diff to previous 37932
Add missing protection. Fixes issue #77725.

Revision 37932 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed Feb 2 01:03:21 2011 UTC (3 years, 11 months ago) by pcanal
File length: 19499 byte(s)
Diff to previous 37531
From Mike Marino:
Fix <http://savannah.cern.ch/bugs/?77570>

In void TRef::SetAction(const char *name) is an incorrect bit shift:

...
   }
   Int_t execid = 1 + fgExecs->IndexOf(exec);
   SetBit(execid << 8);
}

Later use of this in GetObject reads the execid back as:

   if (!obj) {
      //execid in the first 8 bits
      Int_t execid = TestBits(0xff0000);
      if (execid > 0) {
         execid = execid>>16;
         TExec *exec = (TExec*)fgExecs->At(execid-1);

which will always shift the execid to 0.  

The fix is:

   SetBit(execid << 16);

Revision 37531 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Dec 10 20:38:06 2010 UTC (4 years, 1 month ago) by pcanal
File length: 19498 byte(s)
Diff to previous 22961
Fix several memory leaks (TSchemaRuleSet, TClass, TFolder, stress, TStreamerInfo, TFile, TFree)

Introduce a new preprocessor symbol (R__COMPLETE_MEM_TERMINATION) that allows for
better tracking of memory leak.   When ROOT is compiled with this symbols is defined,
globally held objects will be deleted at the time of the process termination.

With this symbol defined, some tests (root.exe -b -l -q ; test/stress ;) run under
'valgrind --leak-check=yes' with no memory leak reports (but still a few still
reacheable blocks).   However, this does not yet support (i.e. segfault at termination) 
the case where TFunctions are created on the 'CINT' stack (and thus fails roottest) and
some uses of CINT functions for fitting ...  and probably also fails on Windows.

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: 19238 byte(s)
Diff to previous 20877
move the directories:
  base clib cont meta metautils newdelete pcre rint thread unix utils
  winnt zip
under the new core meta directory.

Revision 20877 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Mon Nov 19 11:17:07 2007 UTC (7 years, 2 months ago) by rdm
Original Path: trunk/base/src/TRef.cxx
File length: 19238 byte(s)
Diff to previous 19826
Set property svn:eol-style LF on all source and Makefiles. This should avoid
problems with Win32 line endings ending up in the repository. All MS tools
support LF eols fine.

Revision 19826 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed Sep 19 19:56:11 2007 UTC (7 years, 4 months ago) by rdm
Original Path: trunk/base/src/TRef.cxx
File length: 19238 byte(s)
Diff to previous 19825
imported svn:keywords Id property

Revision 19825 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed Sep 19 19:49:10 2007 UTC (7 years, 4 months ago) by rdm
Original Path: trunk/base/src/TRef.cxx
File length: 19285 byte(s)
Diff to previous 17541
remove :$ from tag line

Revision 17541 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Sun Jan 28 18:29:53 2007 UTC (7 years, 11 months ago) by brun
Original Path: trunk/base/src/TRef.cxx
File length: 19295 byte(s)
Diff to previous 17507
-Replace the calls to TVirtualIO by new calls in TBuffer or TDirectory

Revision 17507 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu Jan 25 11:50:36 2007 UTC (8 years ago) by brun
Original Path: trunk/base/src/TRef.cxx
File length: 19300 byte(s)
Diff to previous 14336
 -The inclusion of TFile.h, TStreamerInfo.h, TStreamerElement.h
  has been removed.
 -The code previously in TRef::SetAction has been moved to
  TFileIO::SetRefAction.
 -TRef::Streamer makes use of the new functions in TVirtualIO

With these changes TRef is now independent of the I/O sub-system.

Revision 14336 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Mon Mar 20 21:43:44 2006 UTC (8 years, 10 months ago) by pcanal
Original Path: trunk/base/src/TRef.cxx
File length: 19839 byte(s)
Diff to previous 14054
Reduce direct dependencies on TClass.h, TROOT.h and TStreamerInfo.h.
Warning:  This means that some file that relied on the indirect
inclusion of these header file might now fail to compile with
an error message mention that gROOT is no known or that TClass,
TROOT or TStreamerInfo is incompletely defined.  Simply add the
proper include directive.

Revision 14054 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Feb 17 05:16:38 2006 UTC (8 years, 11 months ago) by pcanal
Original Path: trunk/base/src/TRef.cxx
File length: 19816 byte(s)
Diff to previous 13300
From Axel:
---
Add support for auto-loading of TRefs from multiple TProcessIDs:
TRefTable now stores 2d arrays of branch numbers to load [PID][UID] (via
FillBuffer). The PID index <-> TProcessID-GUID mapping is stored via
TRefTable::Streamer (i.e. once per TTree). Lookup is cached. This change
is both backward and forward compatible, both concerning the interface
and .root files. Only exception is TRefTable::fParentIDs, which is now
only streamed via FillBuffer / ReadBuffer, not as a member of TRefTable.

Minor side-notes:
* Speed-up in TRef::GetObject de-referencing (only once call to
TProcessID::GetObjectWithID).
* No re-reading of a branch if it was already read for an event (if
TBranchRef's fReadEntry == branch-to-autoload's fReadEntry then don't
call GetEntry on it).
* Added getter for TProcessID::fgPIDs->Size()
* updated doc for TRef, TRefTable, TBranchRef, to reflect the current
status of auto-loading.
---

The only change that's breaking backward compatibility (as mentioned
above) is the clear split between per-entry and global streaming of the
TRefTable: there is no use in storing the fParentIDs[][] array (and
fN[]) as part of the TTree members - it should only be stored as part of
the TTree entry. So I've marked them as //!; they're made persistent in
TRefTable::FillBuffer.

The member TRefTable::fSize is only around to suppress a warning in the
schema evolution algorithm (it was a counter before, and the schema
evolution algo is unhappy about fSize missing in the new class
definition, nor does it appreciate fSize being marked as //!). This is
ugly, but I prefer it over a custom streamer.

The patch should fix the following issues:
* autoloading doesn't work because TRefs were created by different
processes,
* changed objects magically overwritten in memory due to re-loading of
referenced objects

Revision 13300 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Mon Nov 21 11:17:18 2005 UTC (9 years, 2 months ago) by rdm
Original Path: trunk/base/src/TRef.cxx
File length: 19650 byte(s)
Diff to previous 13254
coding style fixes.

Revision 13254 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed Nov 16 20:03:58 2005 UTC (9 years, 2 months ago) by pcanal
Original Path: trunk/base/src/TRef.cxx
File length: 19649 byte(s)
Diff to previous 12723
Add fPidOffset to enable the quick transfer  of TKey/TBakset from one file to another

Revision 12723 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Sep 16 08:49:26 2005 UTC (9 years, 4 months ago) by rdm
Original Path: trunk/base/src/TRef.cxx
File length: 19612 byte(s)
Diff to previous 12543
remove redundant const in cast which caused gcc 4 compiler warning.

Revision 12543 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Aug 26 12:17:36 2005 UTC (9 years, 5 months ago) by brun
Original Path: trunk/base/src/TRef.cxx
File length: 19622 byte(s)
Diff to previous 12516
From Axel:
the static TRef::SetObject() works on TRef::fgObject, and is a misnomer
wrt TRef::GetObject(), which works on the referenced object. This patch
names the access to the referenced object GetObject(), while the access
to the static fgObject will be called Get/SetStaticObject(), where
GetStaticObject() is a new function.

TRef::SetObject is kept (for the time being) for back compatibility.

I did not implement TRef::SetObject(const TObject*) (as an alias to
operator=(const TObject*)) to ensure that this interface change will
result in a compiler error if the old TRef::SetObject (now
TRef::SetStaticObject) is used.

Also, TRef::GetObject() now sets fgObject to "this" before calling the
TExec, allowing the TExec to access the TRef's fUniqueID, so it can
determine which object needs to be dereferenced. I need this for storing
the documentation objects.

Docs and the tutorial GetWebHistogram are updated accordingly.

Revision 12516 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Aug 19 07:32:15 2005 UTC (9 years, 5 months ago) by brun
Original Path: trunk/base/src/TRef.cxx
File length: 18680 byte(s)
Diff to previous 11001
Add a few more comments in the TRef class description

Revision 11001 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Jan 28 05:45:41 2005 UTC (9 years, 11 months ago) by brun
Original Path: trunk/base/src/TRef.cxx
File length: 18129 byte(s)
Diff to previous 9831
From Philippe:
This patch solved a problem due to the fact that TObject's fUniqueID can
only hold a 8 bits ProccessID identifier (in addition to storing a 24 bits
object ID).  However we support 65535 distinct ProcsssID identifiers per
file.  Before this patch, for a file containing more than 255 distcint
ProcessID, the
TRef using the later ProcessID would be unable to find their references.

Specifically, fUniqueID can now store the ProcessID indentifier 0 through
254.  When more identifiers
are used, then instead of store the identifier in the 8 higher bit of
fUniqueID we store in a table (TProcessID::fgObjPIDs) linking addresses to
pids.

Revision 9831 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Tue Aug 24 10:41:58 2004 UTC (10 years, 5 months ago) by brun
Original Path: trunk/base/src/TRef.cxx
File length: 18125 byte(s)
Diff to previous 8093
Improve the functionality of the TRefTable.
The new algorithm
  -does not require a pointer to the TRefTable in TFile.
  -can automatically load the branch of a Tree when calling TRef::GetObject
  -works when writing/reading multiple Trees in parallel

Revision 8093 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Jan 30 13:58:48 2004 UTC (10 years, 11 months ago) by brun
Original Path: trunk/base/src/TRef.cxx
File length: 17897 byte(s)
Diff to previous 5823
Fix a bug in TRef::GetObject in case the TRef has a EXEC statement in the comment field

Revision 5823 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Tue Dec 17 10:15:39 2002 UTC (12 years, 1 month ago) by brun
Original Path: trunk/base/src/TRef.cxx
File length: 17895 byte(s)
Diff to previous 5811
Change return type of TProcessID::IsValid from UInt_t to Bool_t

Revision 5811 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Sat Dec 14 07:52:49 2002 UTC (12 years, 1 month ago) by brun
Original Path: trunk/base/src/TRef.cxx
File length: 17898 byte(s)
Diff to previous 5761
In TRef::GetObject, change the test on TProcessID::IsValid.

Revision 5761 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Dec 6 21:30:00 2002 UTC (12 years, 1 month ago) by brun
Original Path: trunk/base/src/TRef.cxx
File length: 17895 byte(s)
Diff to previous 5127
In TRef::GetObject protect against the case where fPID points to
a deleted processID using the new function TProcessID::IsValid.

Revision 5127 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Aug 16 06:18:37 2002 UTC (12 years, 5 months ago) by brun
Original Path: trunk/base/src/TRef.cxx
File length: 17850 byte(s)
Diff to previous 5115
Fix a serious bug in TRef::TRef(TObject *obj) (thanks William Tanenbaum).
fPID was not correctly set. The assignement operator is already doing
all the work.

Revision 5115 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Mon Aug 12 06:24:13 2002 UTC (12 years, 5 months ago) by brun
Original Path: trunk/base/src/TRef.cxx
File length: 18126 byte(s)
Diff to previous 5051
Fix by Bill Tanenbaum
TRef r(0) or TRef r = 0 leaves fPID uninitialized.
The simplest fix is just to add "fPID = 0" as the
first line of the TRef assignment operator that takes a TObject * as an
argument.

Revision 5051 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Sun Aug 4 22:00:57 2002 UTC (12 years, 5 months ago) by rdm
Original Path: trunk/base/src/TRef.cxx
File length: 18085 byte(s)
Diff to previous 5020
fix a few typos in comments.

Revision 5020 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Mon Jul 29 09:04:43 2002 UTC (12 years, 5 months ago) by brun
Original Path: trunk/base/src/TRef.cxx
File length: 18098 byte(s)
Diff to previous 4865
Fix in constructor

Revision 4865 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Tue Jul 9 21:15:39 2002 UTC (12 years, 6 months ago) by brun
Original Path: trunk/base/src/TRef.cxx
File length: 17823 byte(s)
Diff to previous 4723
Add new logic to be able to reference objects with a TUUID (eg TDirectory, TFile).
//
// Special case of a TRef pointing to an object with a TUUID
// ----------------------------------------------------------
// If the referenced object has a TUUID, its bit kHasUUID has been set.
// This case is detected by the TRef assignement operator.
// (For example, TFile and TDirectory have a TUUID)
// The TRef fPID points directly to the single object TProcessUUID (deriving
// from TProcessID) and managing the list of TUUIDs for a process.
// The TRef kAsUUID bit is set and its fUniqueID is set to the fUniqueID
// of the referenced object.
// When the TRef is streamed to a buffer, the corresponding TUUID is also
// streamed with the TRef. When a TRef is read from a buffer, the corresponding
// TUUID is also read and entered into the global list of TUUIDs (if not
// already there). The TRef fUniqueID is set to the UIIDNumber.
// see TProcessUUID for more details.

Revision 4723 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Sun Jun 16 09:10:20 2002 UTC (12 years, 7 months ago) by brun
Original Path: trunk/base/src/TRef.cxx
File length: 15908 byte(s)
Diff to previous 4564
Add conditional debug statements in Streamer (gDebug > 1).

Revision 4564 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Sat May 18 08:22:01 2002 UTC (12 years, 8 months ago) by brun
Original Path: trunk/base/src/TRef.cxx
File length: 15586 byte(s)
Diff to previous 4282
Add explicit calls to the base classes copy constructors in the copy constructors.
This is required by gcc on MacOS X

Revision 4282 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Mon Apr 1 17:19:13 2002 UTC (12 years, 9 months ago) by brun
Original Path: trunk/base/src/TRef.cxx
File length: 15571 byte(s)
Diff to previous 4238
Several changes in the handling of TRef to support the following use case:
An array of objects is written to a file but the TRefs
referencing these objects are not written to the file.
In a next session, these objects are read in memory
and new TRefs point to these objects and are written
to a separate file. In a third session both files
are connected.
To get this scenario working, one must use a dummy TRef
set to all objects that can be referenced in the next session.

Revision 4238 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Mon Mar 25 20:21:06 2002 UTC (12 years, 10 months ago) by brun
Original Path: trunk/base/src/TRef.cxx
File length: 15425 byte(s)
Diff to previous 3847
Implemement TRef operators == and !=
New function TRef::IsValid. IsValid returns kFALSE if a TRef has not
yet been assigned.

Revision 3847 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Sun Feb 3 16:14:31 2002 UTC (12 years, 11 months ago) by brun
Original Path: trunk/base/src/TRef.cxx
File length: 14800 byte(s)
Diff to previous 3839
use GetSessionProcessID instead of GetProcessID(0).

Revision 3839 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Sat Feb 2 11:57:10 2002 UTC (12 years, 11 months ago) by brun
Original Path: trunk/base/src/TRef.cxx
File length: 14788 byte(s)
Diff to previous 3610
Replace gFile by TBuffer::GetParent. With this fix, TRef and TRefArray
read in a TChain should work.

Revision 3610 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Tue Jan 8 11:50:24 2002 UTC (13 years ago) by brun
Original Path: trunk/base/src/TRef.cxx
File length: 14746 byte(s)
Diff to previous 3366
In the assignment operator, initialize fPID if fPID is NULL.
In GetObject, in case of action on demand, call PutObjectWithID
also for the object fPID and not only for the current PID.

Revision 3366 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Mon Dec 3 10:26:36 2001 UTC (13 years, 1 month ago) by brun
Original Path: trunk/base/src/TRef.cxx
File length: 14622 byte(s)
Diff to previous 3351
Reimplement the TRef assignement operator

Revision 3351 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Sun Dec 2 15:20:07 2001 UTC (13 years, 1 month ago) by brun
Original Path: trunk/base/src/TRef.cxx
File length: 14638 byte(s)
Diff to previous 3331
Many changes/simplification of the TRef classes using the new functions
from TProcessID.
With this new version, it is possible to write a TRef to a new file
without writing the referenced object.
Implement assignement operator TRef& operator=(cont TRef &ref).

Revision 3331 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Nov 30 09:04:15 2001 UTC (13 years, 1 month ago) by brun
Original Path: trunk/base/src/TRef.cxx
File length: 15827 byte(s)
Diff to previous 3295
Implement copy constructor

Revision 3295 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed Nov 28 14:49:01 2001 UTC (13 years, 1 month ago) by brun
Original Path: trunk/base/src/TRef.cxx
File length: 15811 byte(s)
Diff to previous 3285
New and backward incompatible version of TRef.
See the long list of comments in the TRef header.
The new version supports lazy instantiation or Action on Demand
when dereferencing a TRef.

Revision 3285 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Nov 23 18:00:21 2001 UTC (13 years, 2 months ago) by brun
Original Path: trunk/base/src/TRef.cxx
File length: 10872 byte(s)
Diff to previous 3283
Add comments describing "Actions on Demand" and modify the code corresponding.

Revision 3283 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu Nov 22 18:10:01 2001 UTC (13 years, 2 months ago) by brun
Original Path: trunk/base/src/TRef.cxx
File length: 7748 byte(s)
Diff to previous 3260
Important addition to the dictionary to support action on demand with TRef
and TRefArray. In this first implementation, only TRef is supported.
The description of this "Action on Demand" also called lazy instantiation
will be provided later in the TRef and TRefArray classes.

Revision 3260 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Tue Nov 20 09:32:54 2001 UTC (13 years, 2 months ago) by brun
Original Path: trunk/base/src/TRef.cxx
File length: 6887 byte(s)
Diff to previous 2984
Move comments such that the description is visible in the html and src.html files.

Revision 2984 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Oct 5 16:26:44 2001 UTC (13 years, 3 months ago) by brun
Original Path: trunk/base/src/TRef.cxx
File length: 7238 byte(s)
Diff to previous 2961
Always cast to Long_t

Revision 2961 - (view) (download) (as text) (annotate) - [select for diffs]
Added Wed Oct 3 16:43:18 2001 UTC (13 years, 3 months ago) by brun
Original Path: trunk/base/src/TRef.cxx
File length: 7188 byte(s)
Rename class TObjectRef to TRef.
We are about to introduce a new class TRefArray (an array of references).

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.

  Diffs between and
  Type of Diff should be a

Sort log by:

Subversion Admin
ViewVC Help
Powered by ViewVC 1.0.9