Hello, Dave
> It would be good, I think, to eventually add a chapter on stuff like this to
> the Root manual.
Please find the "real working" piece of G4 code and ROOT macro.
(thanks Bill Seligman <seligman@nevis1.nevis.columbia.edu> )
These examples use ROOT I/O and TDataSet/TTable classes.
Both classes do define so-called "ownership" you may be interesting in.
See:
http://root.cern.ch/root/htmldoc/TDataSet.html#TDataSet:description
http://root.cern.ch/root/htmldoc/src/TDataSet.cxx.html#TDataSet:Shunt
http://root.cern.ch/root/htmldoc/src/TTable.cxx.html#TTable:Update
Hope this helps.
My best regards and best wishes,
Valeri
> Hi,
> I am trying to understand what facilities are provided for object ownership
> and memory management issues and clean up my own program to make it more
> robust.
>
> Root seems to have a variety of facilities for avoiding memory leakage, but
> there is no global documentation that I have found. There are a lot of
> things going on behind the scenes with TStorage and libNew. On Windows, I
> have not been linking with libNew, since (some time ago) I found that it
> caused problems. In addition, I am calling my class library from Geant4,
> and I'm not sure it is wise to impose a foreign, global operator new/delete
> on that package.
>
> TObject has a bit kNotDeleted; I'm not clear on how this will work without
> libNew. If one deletes something using a vanilla operator new, one is not
> supposed to assume the memory in question is valid afterward. Supposing one
> deletes a TObject with the vanilla operator delete() (i.e. in the absence of
> libNew), how can one use the kNotDeleted bit which is part of the memory
> block you just deleted to check whether that block has, in fact, been
> deleted? kNotDeleted doesn't seem to be really documented anywhere, so many
> I am misunderstanding its intent.
>
>
> Dave
> dcasper@uci.edu
>
>
This archive was generated by hypermail 2b29 : Tue Jan 02 2001 - 11:50:40 MET