RE: [sv-cc] FW: a question about system verilog class deconstructor

From: Jonathan Bromley <jonathan.bromley_at_.....>
Date: Wed Jan 10 2007 - 10:28:03 PST
> I think the language would be well-served by allowing classes
> to optionally declare destructors which run when an object is
> reclaimed by the system.  This would open up different and
> useful object management possibilities in complex designs.

I agree strongly; but I'd question whether "when reclaimed
by the system" is right.  The garbage collector may not get
around to reclaiming an object for a very long time after the
object has been "disowned" (becomes unreachable).  I've already 
raised the issue of a coverage group in an object continuing 
to collect coverage data (and thus making spurious contributions
to the coverage database) after all references to it have been 
lost; there are, I'm sure, many such scenarios to worry about.  
Surely the time to invoke the optional destructor would be when 
an object becomes a *candidate* for reclamation.  And yes, I know 
that's much harder to implement.
-- 
Jonathan Bromley, Consultant

DOULOS - Developing Design Know-how
VHDL * Verilog * SystemC * e * Perl * Tcl/Tk * Project Services

Doulos Ltd. Church Hatch, 22 Market Place, Ringwood, Hampshire, BH24 1AW, UK
Tel: +44 (0)1425 471223                   Email: jonathan.bromley@doulos.com
Fax: +44 (0)1425 471573                           Web: http://www.doulos.com

The contents of this message may contain personal views which 
are not the views of Doulos Ltd., unless specifically stated.

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Received on Wed Jan 10 10:29:02 2007

This archive was generated by hypermail 2.1.8 : Wed Jan 10 2007 - 10:29:05 PST