Browse thread
Re: Weak pointers
- Kohler Markus
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
| Date: | -- (:) |
| 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 | +----------------------------------------------------------------------------+