Weak reference: Difference between revisions

Content deleted Content added
clarity
No edit summary
Line 1:
In [[computer programming]], a '''weak reference''' is a [[reference (computer science)|reference]] that does not protect the referenced [[object (computer science)|object]] from collection by a [[garbage collection (computer science)|garbage collector]], unlike a strong reference. An object referenced ''only'' by weak references – meaning "every chain of references that reaches the object includes at least one weak reference as a link" – is considered ''[[weakly reachable]],'' and can be treated as [[unreachable memory|unreachable]] and so may be collected at any time. Some garbage-collected languages feature or support various levels of weak references, such as [[C Sharp (programming language)|C#]], [[Java (programming language)|Java]], [[C SharpLisp (programming language)|C#Lisp]], [[OCaml]], [[Perl]], and [[Python (programming language)|Python]],<ref>[https://docs.python.org/3/library/weakref.html 8.8. weakref — Weak references], The Python Standard Library</ref> [[Perl]], and [[Lisp (programming language)|Lisp]].
 
==Uses==