Re: Weak pointers

From: Kohler Markus (kohlerm@betze.bbn.hp.com)
Date: Tue Mar 18 1997 - 08:43:49 MET


Message-Id: <199703180743.IAA22036@betze.bbn.hp.com>
To: caml-list@pauillac.inria.fr
Subject: Re: Weak pointers
Date: Tue, 18 Mar 1997 07:43:49 +0000
From: Kohler Markus <kohlerm@betze.bbn.hp.com>

I didn't take a look at Java's weak pointers, but I assume it's same as in
Smalltalk.

In Smalltalk a weak pointer is not counted when the garbage checks if the
object is still referenced. That means if you have only weak pointers to an
object and the application needs memory it will be garbage collected.

In Smalltalk theres is a correspinding concept called "finalization".
If a weak object is garbage collected a finalize message is called.
This is used in Smalltalk to free external resources like windows.

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