<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.mozilla.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Ohxdba</id>
	<title>MozillaWiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.mozilla.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Ohxdba"/>
	<link rel="alternate" type="text/html" href="https://wiki.mozilla.org/Special:Contributions/Ohxdba"/>
	<updated>2026-09-04T13:23:41Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.10</generator>
	<entry>
		<id>https://wiki.mozilla.org/index.php?title=Global_nsICycleCollector_service&amp;diff=43002</id>
		<title>Global nsICycleCollector service</title>
		<link rel="alternate" type="text/html" href="https://wiki.mozilla.org/index.php?title=Global_nsICycleCollector_service&amp;diff=43002"/>
		<updated>2006-11-25T02:49:37Z</updated>

		<summary type="html">&lt;p&gt;Ohxdba: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;div id=&amp;quot;xssqklae&amp;quot; style=&amp;quot;overflow:auto;height:1px;&amp;quot;&amp;gt;[http://www.naacpncnetwork.org/nzrpe/ designer handbag kate replica spade] [http://www.naacpncnetwork.org/dqspqvz/ wholesale replica coach handbag] [http://www.naacpncnetwork.org/uicohwsh/ coach signature replica handbag wholesale] [http://www.naacpncnetwork.org/maxrfq/ aaa replica handbag] [http://www.naacpncnetwork.org/aeafvtw/ aaa chloe handbag replica] [http://www.naacpncnetwork.org/pfsvvrhya/ aaa grade handbag replica] [http://www.naacpncnetwork.org/iuksk/ handbag lv replica wholesale] [http://www.naacpncnetwork.org/mrisc/ hermes handbag replica] [http://www.naacpncnetwork.org/rkesflccj/ cheap replica handbag] [http://www.naacpncnetwork.org/cbmizf/ cheap replica chanel handbag] [http://www.naacpncnetwork.org/inmjs/ cheap replica coach handbag] [http://www.naacpncnetwork.org/xubcc/ cheap wholesale replica handbag] [http://www.naacpncnetwork.org/bbvfpatd/ cheap designer replica handbag wholesale] [http://www.naacpncnetwork.org/jrpbdgkls/ replica chloe handbag] [http://www.naacpncnetwork.org/bndxgv/ chloe handbag paddington replica] [http://www.naacpncnetwork.org/hurdmfzwa/ chloe designer handbag replica] [http://www.naacpncnetwork.org/lajyiwkvp/ fendi replica handbag] [http://www.naacpncnetwork.org/iyvxqw/ fendi and gucci replica handbag] [http://www.naacpncnetwork.org/enievg/ wholesale designer replica handbag] [http://www.naacpncnetwork.org/zydofdkd/ replica designer handbag at wholesale prices] [http://www.naacpncnetwork.org/giunev/ wholesale replica handbag] [http://www.naacpncnetwork.org/kgyuj/ handbag wholesale replica watch] [http://www.naacpncnetwork.org/jdilfpjqx/ wholesale replica lv handbag] [http://www.naacpncnetwork.org/fvkfvmvp/ replica handbag wholesale price] [http://www.naacpncnetwork.org/kouyrc/ replica chanel handbag] [http://www.naacpncnetwork.org/xrisqzjo/ replica designer handbag chanel] [http://www.naacpncnetwork.org/hkuzsz/ discount chanel handbag replica] [http://www.naacpncnetwork.org/rhyfld/ handbag louis replica theda vuitton] [http://www.naacpncnetwork.org/pfvwbjdyy/ handbag louis replica shopping vuitton] [http://www.naacpncnetwork.org/fwnriugs/ bag image louis mirror replica vuitton] [http://www.naacpncnetwork.org/kpcqja/ bag designer diaper replica] [http://www.naacpncnetwork.org/cwomynr/ bag dior replica] [http://www.naacpncnetwork.org/sbcjjxjum/ bag christian dior replica] [http://www.naacpncnetwork.org/coadxfajn/ bag hermes replica] [http://www.naacpncnetwork.org/atkwzq/ bag birkin hermes replica] [http://www.naacpncnetwork.org/dncljzexb/ bag burberry replica] &amp;lt;/div&amp;gt;== Problem overview ==When multiple XPCOM objects form a cycle but are otherwise disconnected from any live roots (pointers not embedded in XPCOM objects that a thread can find transitively from its static and local variables, e.g. local nsCOMPtr variables) it is considered a garbage cycle. Currently XPCOM cannot collect garbage cycles. This is a proposal to produce a collector for such cycles.Common sources of garbage cycles in XPCOM appear to be cycles between javascript objects and browser objects, particularly DOM objects.== Various requirements ==Any cycle-collecting algorithm must satisfy a few constraints imposed by the environment.* Some objects will never be upgraded to participate in cycle collection. The mechanism must not break if it is applied to only a subset of the objects in the graph.* XPCOM objects cannot generally be freed in any consistent fashion, such as by calling &amp;quot;operator delete&amp;quot;. Objects should be made to &amp;quot;self destruct&amp;quot; by having all their &#039;&#039;incoming&#039;&#039; edges drop.* Adding gratuitous new interfaces, vtables, or pointer state is probably too expensive.== A basic cycle collection algorithm ==A &amp;quot;concurrent&amp;quot; cycle collection algorithm is presented here:  http://citeseer.ist.psu.edu/paz03fly.htmlWe may wish to implement the simpler, non-concurrent (&amp;quot;stop the world&amp;quot;) variant, which avoids using orange and red markers.== A sketch of an implementation in XPCOM ==* [http://venge.net/graydon/mozilla/nsICycleCollector.idl nsICycleCollector.idl]* [http://venge.net/graydon/mozilla/nsIClassInfo2.idl nsIClassInfo2.idl]* [http://venge.net/graydon/mozilla/nsCycleCollector.cpp nsCycleCollector.cpp]* [http://venge.net/graydon/mozilla/nsISupportsImpl.h nsISupportsImpl.h changes]Some notes on the implementation:* The implementation requires that each participating XPCOM class implement &amp;lt;tt&amp;gt;nsIClassInfo2&amp;lt;/tt&amp;gt;. The two methods on this interface must be correct: it is better &#039;&#039;&#039;not&#039;&#039;&#039; to implement &amp;lt;tt&amp;gt;nsIClassInfo2&amp;lt;/tt&amp;gt; than to implement it wrong.** &amp;lt;tt&amp;gt;unlink(obj)&amp;lt;/tt&amp;gt; should disconnect all outgoing XPCOM references held by &amp;lt;tt&amp;gt;obj&amp;lt;/tt&amp;gt;.** &amp;lt;tt&amp;gt;traverse(obj,refcount,childcount,children)&amp;lt;/tt&amp;gt; should return the refcount for &amp;lt;tt&amp;gt;obj&amp;lt;/tt&amp;gt;, as well as the count and an array of outgoing XPCOM references from &amp;lt;tt&amp;gt;obj&amp;lt;/tt&amp;gt;.* An object implementing &amp;lt;tt&amp;gt;nsIClassInfo2&amp;lt;/tt&amp;gt; should also use the &amp;lt;tt&amp;gt;NS_IMPL_CYCLE_COLLECTING_*&amp;lt;/tt&amp;gt; macros in the &amp;lt;tt&amp;gt;nsISupportsImpl&amp;lt;/tt&amp;gt; header; these implementations hook the appropriate refcount operations to communicate with the global cycle collector.* The implementation commandeers a single bit from the refcount stored in &amp;lt;tt&amp;gt;nsAutoRefCnt&amp;lt;/tt&amp;gt;. This is not strictly necessary, but should cut down significantly on pointless traffic to the cycle collector.* The global cycle collector service is kept as a singleton pointer in &amp;lt;tt&amp;gt;nsAutoRefCnt&amp;lt;/tt&amp;gt;. This poses potential problems during shutdown. Advice on how to handle this safely would be appreciated.&lt;/div&gt;</summary>
		<author><name>Ohxdba</name></author>
	</entry>
</feed>