RE: [ROOT] Streamers and //!

From: Axel Naumann (axel@fnal.gov)
Date: Sat Jan 27 2001 - 04:07:30 MET


Hi Robert,

MyObj::Streamer calls MyObj::MyObj(), and this is where the temp state vars
should be set. So the only potential problem is a default constructor that
doesn't properly initialize the members. But that's just c++ (and fine with
me).

Cheers, Axel.

> -----Original Message-----
> From: owner-roottalk@pcroot.cern.ch
> [mailto:owner-roottalk@pcroot.cern.ch]On Behalf Of Robert Hatcher
> Sent: Friday, January 26, 2001 6:49 PM
> To: roottalk@pcroot.cern.ch
> Subject: [ROOT] Streamers and //!
>
>
> Rootcint currently completely ignores data members when they have
> a trailing comment "//!" which is to indicate that they are temporary
> state variables.  I think this is a potential problem if this data member
> is a pointer and the automagically generated Streamer does *not* fill
> this data member and it is left with whatever value happened to be
> at that memory location.  In the case of pointers the value "0" is
> indicative  that it points at nothing and the presence of garbage
> is generally disasterous.
>
> Under Unix with the use of libNew this might not be a problem as I
> think the memory space may get cleared. (Could someone alleviate my
> worries here?)   But I would feel much more comfortable if the rootcint
> generated streamer explicitly set this field in the case of
> R__b.IsReading().  I'd like to propose that rootcint be expanded to:
>
>    //!   ignore field on write, zero on read (safety)
>    //!!  ignore field in all cases (speed)
>
> -robert
>
> Robert W. Hatcher   |  rhatcher@slac.stanford.edu
> Research Associate  |  650.926.3171  [FAX 4001 or 3587]
> Stanford University |  PO Box 4349, MS #63, Stanford CA 94309
>
>
>



This archive was generated by hypermail 2b29 : Tue Jan 01 2002 - 17:50:34 MET