Content deleted Content added
Magioladitis (talk | contribs) Undid revision 1225073521 by Magioladitis (talk) |
Added MATLAB with a reference |
||
Line 1:
{{Short description|In programming, a reference which does not protect its object from garbage collection}}
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#]], [[Lua (programming language)|Lua]], [[Java (programming language)|Java]], [[Lisp (programming language)|Lisp]], [[OCaml]], [[MATLAB]]<ref>[https://uk.mathworks.com/help/matlab/matlab_oop/weak-reference-handles.html]</ref>, [[Perl]], [[Python (programming language)|Python]]<ref>[https://docs.python.org/3/library/weakref.html 8.8. weakref — Weak references], The Python Standard Library</ref> and [[PHP]] since the version 7.4.<ref>{{Cite web|url=https://www.php.net/manual/en/class.weakreference.php|title = PHP: WeakReference - Manual}}</ref>
==Uses==
|