Re: Weak pointers

From: Kohler Markus (kohlerm@betze.bbn.hp.com)
Date: Tue Mar 18 1997 - 16:51:46 MET


Message-Id: <199703181551.QAA27551@betze.bbn.hp.com>
To: Damien Doligez <Damien.Doligez@inria.fr>
Subject: Re: Weak pointers
In-Reply-To: Damien.Doligez's message of Tue, 18 Mar 1997 15:34:54 +0100.
      <199703181434.PAA12806@tobago.inria.fr>
Date: Tue, 18 Mar 1997 15:51:46 +0000
From: Kohler Markus <kohlerm@betze.bbn.hp.com>

> >The problem is that if you delete an element in the tree it may be that the
> >hash table still points to the node, because there was no garbage collection
> >yet. It could be possible that you would still find the entry trough the hash
> >table.
>
> I don't see a problem here. You find the entry and use it instead of
> allocating a new node. This is a rather good thing. It means you
> avoid allocating, and leave less garbage for the GC to collect.
>

But how do you know then that value is not valid anymore ?
I you use a flag to indicate that then I don't see an advantage of using a
weak pointer.
The same could be done with a "normal" pointer.

Markus
  

 

-- 
+----------------------------------------------------------------------------+
| Markus Kohler                          Hewlett-Packard GmbH                |
| Software Engineer                      Network & System Management Division| 
|                                        IT/E Success Team                   |
+----------------------------------------------------------------------------+



This archive was generated by hypermail 2b29 : Sun Jan 02 2000 - 11:58:09 MET