English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
Re: Weak pointers
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 1997-03-18 (09:39)
From: Kohler Markus <kohlerm@b...>
Subject: Re: Weak pointers
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                   |
+----------------------------------------------------------------------------+