Weak reference: Difference between revisions

Content deleted Content added
m Making Wikipedia great, References after punctuation per WP:CITEFOOT and WP:PAIC using AWB (12151)
Added {{linkrot}} tag to article (TW)
Line 1:
{{linkrot|date=June 2017}}
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]], [[Lisp (programming language)|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>