<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://mediawiki.zeropage.org/index.php?action=history&amp;feed=atom&amp;title=Garbage_collector_for_C_and_C%2B%2B</id>
	<title>Garbage collector for C and C++ - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://mediawiki.zeropage.org/index.php?action=history&amp;feed=atom&amp;title=Garbage_collector_for_C_and_C%2B%2B"/>
	<link rel="alternate" type="text/html" href="https://mediawiki.zeropage.org/index.php?title=Garbage_collector_for_C_and_C%2B%2B&amp;action=history"/>
	<updated>2026-05-14T18:47:10Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.8</generator>
	<entry>
		<id>https://mediawiki.zeropage.org/index.php?title=Garbage_collector_for_C_and_C%2B%2B&amp;diff=84401&amp;oldid=prev</id>
		<title>Maintenance script: Repair batch-0002 pages from live compare</title>
		<link rel="alternate" type="text/html" href="https://mediawiki.zeropage.org/index.php?title=Garbage_collector_for_C_and_C%2B%2B&amp;diff=84401&amp;oldid=prev"/>
		<updated>2026-03-27T00:16:03Z</updated>

		<summary type="html">&lt;p&gt;Repair batch-0002 pages from live compare&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 00:16, 27 March 2026&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l4&quot;&gt;Line 4:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 4:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* README.QUICK 파일에 기본적인 설명이 있다. doc/README.* 에 플렛폼별 자세한 설명이 있다.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* README.QUICK 파일에 기본적인 설명이 있다. doc/README.* 에 플렛폼별 자세한 설명이 있다.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* 유닉스나 리눅스에서는 &amp;quot;./configure --prefix=&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;amp;lt;&lt;/del&gt;dir&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;amp;gt;&lt;/del&gt;; make; make check; make install&amp;quot; 으로 인스톨 할수 있다.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* 유닉스나 리눅스에서는 &amp;quot;./configure --prefix=&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;&lt;/ins&gt;dir&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;gt;&lt;/ins&gt;; make; make check; make install&amp;quot; 으로 인스톨 할수 있다.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;** C++ 인터 페이스를 추가 하기 위해서는 &amp;quot;make c++&amp;quot; 을 하여야 한다.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;** C++ 인터 페이스를 추가 하기 위해서는 &amp;quot;make c++&amp;quot; 을 하여야 한다.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l30&quot;&gt;Line 30:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 30:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* C++ 에서 사용하려면 -DGC_OPERATOR_NEW_ARRAY 를 추가하여 컴파일 하는 것이 좋다.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* C++ 에서 사용하려면 -DGC_OPERATOR_NEW_ARRAY 를 추가하여 컴파일 하는 것이 좋다.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  class A: public gc {...};&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  class A: public gc {...};&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  A* a1 = new A&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[ &lt;/del&gt;10 &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;]&lt;/del&gt;;        // collectable or uncollectable? (컴파일러마다 다른 결과가 나온다.)&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  A* a1 = new A&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;amp;#91; &lt;/ins&gt;10 &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;amp;#93;&lt;/ins&gt;;        // collectable or uncollectable? (컴파일러마다 다른 결과가 나온다.)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  A* a2 = new (GC) A&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[ &lt;/del&gt;10 &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;]&lt;/del&gt;;   // collectable&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  A* a2 = new (GC) A&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;amp;#91; &lt;/ins&gt;10 &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;amp;#93;&lt;/ins&gt;;   // collectable&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;    &lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;    &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l85&quot;&gt;Line 85:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 85:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  #   since this may avoid some expensive cache synchronization.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  #   since this may avoid some expensive cache synchronization.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  # -DGC_NO_OPERATOR_NEW_ARRAY declares that the C++ compiler does not support&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  # -DGC_NO_OPERATOR_NEW_ARRAY declares that the C++ compiler does not support&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  #   the  new syntax &amp;quot;operator new&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[]&lt;/del&gt;&amp;quot; for allocating and deleting arrays.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  #   the  new syntax &amp;quot;operator new&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;amp;#91;&amp;amp;#93;&lt;/ins&gt;&amp;quot; for allocating and deleting arrays.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  #   See gc_cpp.h for details.  No effect on the C part of the collector.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  #   See gc_cpp.h for details.  No effect on the C part of the collector.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  #   This is defined implicitly in a few environments.  Must also be defined&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  #   This is defined implicitly in a few environments.  Must also be defined&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l239&quot;&gt;Line 239:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 239:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;----&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;----&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[도구분류]]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[도구분류]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Maintenance script</name></author>
	</entry>
	<entry>
		<id>https://mediawiki.zeropage.org/index.php?title=Garbage_collector_for_C_and_C%2B%2B&amp;diff=31929&amp;oldid=prev</id>
		<title>imported&gt;Unknown at 05:23, 7 February 2021</title>
		<link rel="alternate" type="text/html" href="https://mediawiki.zeropage.org/index.php?title=Garbage_collector_for_C_and_C%2B%2B&amp;diff=31929&amp;oldid=prev"/>
		<updated>2021-02-07T05:23:18Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;[http://www.hpl.hp.com/personal/Hans_Boehm/gc/ 홈페이지]&lt;br /&gt;
&lt;br /&gt;
= 인스톨 =&lt;br /&gt;
* README.QUICK 파일에 기본적인 설명이 있다. doc/README.* 에 플렛폼별 자세한 설명이 있다.&lt;br /&gt;
&lt;br /&gt;
* 유닉스나 리눅스에서는 &amp;quot;./configure --prefix=&amp;amp;lt;dir&amp;amp;gt;; make; make check; make install&amp;quot; 으로 인스톨 할수 있다.&lt;br /&gt;
** C++ 인터 페이스를 추가 하기 위해서는 &amp;quot;make c++&amp;quot; 을 하여야 한다.&lt;br /&gt;
&lt;br /&gt;
* GNU-win32 에서는 기본으로 있는 Makefile 을 사용하면된다. &lt;br /&gt;
  /! 시스템에 따라 Makefile 내용 중 CC=cc 를 CC=gcc 로 수정하여야 한다.&lt;br /&gt;
** C++ 인터 페이스를 추가 하기 위해서는 &amp;quot;make c++&amp;quot; 을 하여야 한다.&lt;br /&gt;
&lt;br /&gt;
* MS 개발 툴을 사용한다면 NT_MAKEFILE 을 MAKEFILE 로 이름을 바꾸어 사용한다.&lt;br /&gt;
** win32 쓰레드를 지원하려면 NT_THREADS_MAKEFILE 을 사용한다. (gc.mak 도 같은 파일 이다.)&lt;br /&gt;
** 예) nmake /F &amp;quot;.gc.mak&amp;quot; CFG=&amp;quot;gctest - Win32 Release&amp;quot;&lt;br /&gt;
&lt;br /&gt;
* 볼랜드 개발 툴을 사용한다면 BCC_MAKEFILE 을 사용한다. &lt;br /&gt;
&lt;br /&gt;
== 내가 사용한 인스톨 ==&lt;br /&gt;
* WinXP, MinGW, Msys&lt;br /&gt;
** Makefile 수정 내용.&lt;br /&gt;
** CC=cc 를 CC=gcc 로 수정.&lt;br /&gt;
** -DGC_OPERATOR_NEW_ARRAY -DJAVA_FINALIZATION 을 CFLAGS 에 추가.&lt;br /&gt;
&lt;br /&gt;
** 빌드&lt;br /&gt;
** make c++&lt;br /&gt;
&lt;br /&gt;
== 이슈 ==&lt;br /&gt;
* Windows NT 나 Windows 2000 에서 문제가 발생한다면 -DUSE_GLOBAL_ALLOC 나 -DUSE_MUNMAP 옵션을 사용하여 컴파일 한다.&lt;br /&gt;
* C++ 에서 사용하려면 -DGC_OPERATOR_NEW_ARRAY 를 추가하여 컴파일 하는 것이 좋다.&lt;br /&gt;
 class A: public gc {...};&lt;br /&gt;
 A* a1 = new A[ 10 ];        // collectable or uncollectable? (컴파일러마다 다른 결과가 나온다.)&lt;br /&gt;
 A* a2 = new (GC) A[ 10 ];   // collectable&lt;br /&gt;
  &lt;br /&gt;
&lt;br /&gt;
== 옵션 ==&lt;br /&gt;
 # -DSILENT disables statistics printing, and improves performance.&lt;br /&gt;
 # -DFIND_LEAK causes GC_find_leak to be initially set.&lt;br /&gt;
 #   This causes the collector to assume that all inaccessible&lt;br /&gt;
 #   objects should have been explicitly deallocated, and reports exceptions.&lt;br /&gt;
 #   Finalization and the test program are not usable in this mode.&lt;br /&gt;
 # -DGC_SOLARIS_THREADS enables support for Solaris (thr_) threads.&lt;br /&gt;
 #   (Clients should also define GC_SOLARIS_THREADS and then include&lt;br /&gt;
 #   gc.h before performing thr_ or dl* or GC_ operations.)&lt;br /&gt;
 #   Must also define -D_REENTRANT.&lt;br /&gt;
 # -DGC_SOLARIS_PTHREADS enables support for Solaris pthreads.&lt;br /&gt;
 #   (Internally this define GC_SOLARIS_THREADS as well.)&lt;br /&gt;
 # -DGC_IRIX_THREADS enables support for Irix pthreads.  See README.irix.&lt;br /&gt;
 # -DGC_HPUX_THREADS enables support for HP/UX 11 pthreads.&lt;br /&gt;
 #   Also requires -D_REENTRANT or -D_POSIX_C_SOURCE=199506L. See README.hp.&lt;br /&gt;
 # -DGC_LINUX_THREADS enables support for Xavier Leroy&amp;#039;s Linux threads.&lt;br /&gt;
 #   see README.linux.  -D_REENTRANT may also be required.&lt;br /&gt;
 # -DGC_OSF1_THREADS enables support for Tru64 pthreads.  Untested.&lt;br /&gt;
 # -DGC_FREEBSD_THREADS enables support for FreeBSD pthreads.  Untested.&lt;br /&gt;
 #   Appeared to run into some underlying thread problems.&lt;br /&gt;
 # -DGC_DGUX386_THREADS enables support for DB/UX on I386 threads.&lt;br /&gt;
 #   See README.DGUX386.&lt;br /&gt;
 # -DALL_INTERIOR_POINTERS allows all pointers to the interior&lt;br /&gt;
 #   of objects to be recognized.  (See gc_priv.h for consequences.)&lt;br /&gt;
 #   Alternatively, GC_all_interior_pointers can be set at process&lt;br /&gt;
 #   initialization time.&lt;br /&gt;
 # -DSMALL_CONFIG tries to tune the collector for small heap sizes,&lt;br /&gt;
 #   usually causing it to use less space in such situations.&lt;br /&gt;
 #   Incremental collection no longer works in this case.&lt;br /&gt;
 # -DLARGE_CONFIG tunes the collector for unusually large heaps.&lt;br /&gt;
 #   Necessary for heaps larger than about 500 MB on most machines.&lt;br /&gt;
 #   Recommended for heaps larger than about 64 MB.&lt;br /&gt;
 # -DDONT_ADD_BYTE_AT_END is meaningful only with -DALL_INTERIOR_POINTERS or&lt;br /&gt;
 #   GC_all_interior_pointers = 1.  Normally -DALL_INTERIOR_POINTERS&lt;br /&gt;
 #   causes all objects to be padded so that pointers just past the end of&lt;br /&gt;
 #   an object can be recognized.  This can be expensive.  (The padding&lt;br /&gt;
 #   is normally more than one byte due to alignment constraints.)&lt;br /&gt;
 #   -DDONT_ADD_BYTE_AT_END disables the padding.&lt;br /&gt;
 # -DNO_SIGNALS does not disable signals during critical parts of&lt;br /&gt;
 #   the GC process.  This is no less correct than many malloc &lt;br /&gt;
 #   implementations, and it sometimes has a significant performance&lt;br /&gt;
 #   impact.  However, it is dangerous for many not-quite-ANSI C&lt;br /&gt;
 #   programs that call things like printf in asynchronous signal handlers.&lt;br /&gt;
 #   This is on by default.  Turning it off has not been extensively tested with&lt;br /&gt;
 #   compilers that reorder stores.  It should have been.&lt;br /&gt;
 # -DNO_EXECUTE_PERMISSION may cause some or all of the heap to not&lt;br /&gt;
 #   have execute permission, i.e. it may be impossible to execute&lt;br /&gt;
 #   code from the heap.  Currently this only affects the incremental&lt;br /&gt;
 #   collector on UNIX machines.  It may greatly improve its performance,&lt;br /&gt;
 #   since this may avoid some expensive cache synchronization.&lt;br /&gt;
 # -DGC_NO_OPERATOR_NEW_ARRAY declares that the C++ compiler does not support&lt;br /&gt;
 #   the  new syntax &amp;quot;operator new[]&amp;quot; for allocating and deleting arrays.&lt;br /&gt;
 #   See gc_cpp.h for details.  No effect on the C part of the collector.&lt;br /&gt;
 #   This is defined implicitly in a few environments.  Must also be defined&lt;br /&gt;
 #   by clients that use gc_cpp.h.&lt;br /&gt;
 # -DREDIRECT_MALLOC=X causes malloc to be defined as alias for X.&lt;br /&gt;
 #   Unless the following macros are defined, realloc is also redirected&lt;br /&gt;
 #   to GC_realloc, and free is redirected to GC_free.&lt;br /&gt;
 #   Calloc and strdup are redefined in terms of the new malloc.  X should&lt;br /&gt;
 #   be either GC_malloc or GC_malloc_uncollectable, or&lt;br /&gt;
 #   GC_debug_malloc_replacement.  (The latter invokes GC_debug_malloc&lt;br /&gt;
 #   with dummy source location information, but still results in&lt;br /&gt;
 #   properly remembered call stacks on Linux/X86 and Solaris/SPARC.&lt;br /&gt;
 #   It requires that the following two macros also be used.)&lt;br /&gt;
 #   The former is occasionally useful for working around leaks in code&lt;br /&gt;
 #   you don&amp;#039;t want to (or can&amp;#039;t) look at.  It may not work for&lt;br /&gt;
 #   existing code, but it often does.  Neither works on all platforms,&lt;br /&gt;
 #   since some ports use malloc or calloc to obtain system memory.&lt;br /&gt;
 #   (Probably works for UNIX, and win32.)  If you build with DBG_HDRS_ALL,&lt;br /&gt;
 #   you should only use GC_debug_malloc_replacement as a malloc&lt;br /&gt;
 #   replacement.&lt;br /&gt;
 # -DREDIRECT_REALLOC=X causes GC_realloc to be redirected to X.&lt;br /&gt;
 #   The canonical use is -DREDIRECT_REALLOC=GC_debug_realloc_replacement,&lt;br /&gt;
 #   together with -DREDIRECT_MALLOC=GC_debug_malloc_replacement to&lt;br /&gt;
 #   generate leak reports with call stacks for both malloc and realloc.&lt;br /&gt;
 #   This also requires the following:&lt;br /&gt;
 # -DREDIRECT_FREE=X causes free to be redirected to X.  The&lt;br /&gt;
 #   canonical use is -DREDIRECT_FREE=GC_debug_free.&lt;br /&gt;
 # -DIGNORE_FREE turns calls to free into a noop.  Only useful with&lt;br /&gt;
 #   -DREDIRECT_MALLOC.&lt;br /&gt;
 # -DNO_DEBUGGING removes GC_dump and the debugging routines it calls.&lt;br /&gt;
 #   Reduces code size slightly at the expense of debuggability.&lt;br /&gt;
 # -DJAVA_FINALIZATION makes it somewhat safer to finalize objects out of&lt;br /&gt;
 #   order by specifying a nonstandard finalization mark procedure  (see&lt;br /&gt;
 #   finalize.c).  Objects reachable from finalizable objects will be marked&lt;br /&gt;
 #   in a sepearte postpass, and hence their memory won&amp;#039;t be reclaimed.&lt;br /&gt;
 #   Not recommended unless you are implementing a language that specifies&lt;br /&gt;
 #   these semantics.  Since 5.0, determines only only the initial value&lt;br /&gt;
 #   of GC_java_finalization variable.&lt;br /&gt;
 # -DFINALIZE_ON_DEMAND causes finalizers to be run only in response&lt;br /&gt;
 #   to explicit GC_invoke_finalizers() calls.&lt;br /&gt;
 #   In 5.0 this became runtime adjustable, and this only determines the&lt;br /&gt;
 #   initial value of GC_finalize_on_demand.&lt;br /&gt;
 # -DATOMIC_UNCOLLECTABLE includes code for GC_malloc_atomic_uncollectable.&lt;br /&gt;
 #   This is useful if either the vendor malloc implementation is poor,&lt;br /&gt;
 #   or if REDIRECT_MALLOC is used.&lt;br /&gt;
 # -DHBLKSIZE=ddd, where ddd is a power of 2 between 512 and 16384, explicitly&lt;br /&gt;
 #   sets the heap block size.  Each heap block is devoted to a single size and&lt;br /&gt;
 #   kind of object.  For the incremental collector it makes sense to match&lt;br /&gt;
 #   the most likely page size.  Otherwise large values result in more&lt;br /&gt;
 #   fragmentation, but generally better performance for large heaps.&lt;br /&gt;
 # -DUSE_MMAP use MMAP instead of sbrk to get new memory.&lt;br /&gt;
 #   Works for Solaris and Irix.&lt;br /&gt;
 # -DUSE_MUNMAP causes memory to be returned to the OS under the right&lt;br /&gt;
 #   circumstances.  This currently disables VM-based incremental collection.&lt;br /&gt;
 #   This is currently experimental, and works only under some Unix,&lt;br /&gt;
 #   Linux and Windows versions.&lt;br /&gt;
 # -DMMAP_STACKS (for Solaris threads) Use mmap from /dev/zero rather than&lt;br /&gt;
 #   GC_scratch_alloc() to get stack memory.&lt;br /&gt;
 # -DPRINT_BLACK_LIST Whenever a black list entry is added, i.e. whenever&lt;br /&gt;
 #   the garbage collector detects a value that looks almost, but not quite,&lt;br /&gt;
 #   like a pointer, print both the address containing the value, and the&lt;br /&gt;
 #   value of the near-bogus-pointer.  Can be used to identifiy regions of&lt;br /&gt;
 #   memory that are likely to contribute misidentified pointers.&lt;br /&gt;
 # -DKEEP_BACK_PTRS Add code to save back pointers in debugging headers&lt;br /&gt;
 #   for objects allocated with the debugging allocator.  If all objects&lt;br /&gt;
 #   through GC_MALLOC with GC_DEBUG defined, this allows the client&lt;br /&gt;
 #   to determine how particular or randomly chosen objects are reachable&lt;br /&gt;
 #   for debugging/profiling purposes.  The gc_backptr.h interface is&lt;br /&gt;
 #   implemented only if this is defined.&lt;br /&gt;
 # -DGC_ASSERTIONS Enable some internal GC assertion checking.  Currently&lt;br /&gt;
 #   this facility is only used in a few places.  It is intended primarily&lt;br /&gt;
 #   for debugging of the garbage collector itself, but could also&lt;br /&gt;
 # -DDBG_HDRS_ALL Make sure that all objects have debug headers.  Increases&lt;br /&gt;
 #   the reliability (from 99.9999% to 100%) of some of the debugging&lt;br /&gt;
 #   code (especially KEEP_BACK_PTRS).  Makes -DSHORT_DBG_HDRS possible.&lt;br /&gt;
 #   Assumes that all client allocation is done through debugging&lt;br /&gt;
 #   allocators.&lt;br /&gt;
 # -DSHORT_DBG_HDRS Assume that all objects have debug headers.  Shorten&lt;br /&gt;
 #   the headers to minimize object size, at the expense of checking for&lt;br /&gt;
 #   writes past the end of an object.  This is intended for environments&lt;br /&gt;
 #   in which most client code is written in a &amp;quot;safe&amp;quot; language, such as&lt;br /&gt;
 #   Scheme or Java.  Assumes that all client allocation is done using&lt;br /&gt;
 #   the GC_debug_ functions, or through the macros that expand to these,&lt;br /&gt;
 #   or by redirecting malloc to GC_debug_malloc_replacement.&lt;br /&gt;
 #   (Also eliminates the field for the requested object size.)&lt;br /&gt;
 #   occasionally be useful for debugging of client code.  Slows down the&lt;br /&gt;
 #   collector somewhat, but not drastically.&lt;br /&gt;
 # -DSAVE_CALL_COUNT=&amp;amp;lt;n&amp;amp;gt; Set the number of call frames saved with objects&lt;br /&gt;
 #   allocated through the debugging interface.  Affects the amount of&lt;br /&gt;
 #   information generated in leak reports.  Only matters on platforms&lt;br /&gt;
 #   on which we can quickly generate call stacks, currently Linux/(X86 &amp;amp;amp; SPARC)&lt;br /&gt;
 #   and Solaris/SPARC and platforms that provide execinfo.h.&lt;br /&gt;
 #   Default is zero.  On X86, client&lt;br /&gt;
 #   code should NOT be compiled with -fomit-frame-pointer.&lt;br /&gt;
 # -DSAVE_CALL_NARGS=&amp;amp;lt;n&amp;amp;gt; Set the number of functions arguments to be&lt;br /&gt;
 #   saved with each call frame.  Default is zero.  Ignored if we&lt;br /&gt;
 #   don&amp;#039;t know how to retrieve arguments on the platform.&lt;br /&gt;
 # -DCHECKSUMS reports on erroneously clear dirty bits, and unexpectedly&lt;br /&gt;
 #   altered stubborn objects, at substantial performance cost.&lt;br /&gt;
 #   Use only for debugging of the incremental collector.&lt;br /&gt;
 # -DGC_GCJ_SUPPORT includes support for gcj (and possibly other systems&lt;br /&gt;
 #   that include a pointer to a type descriptor in each allocated object).&lt;br /&gt;
 #   Building this way requires an ANSI C compiler.&lt;br /&gt;
 # -DUSE_I686_PREFETCH causes the collector to issue Pentium III style&lt;br /&gt;
 #   prefetch instructions.  No effect except on X86 Linux platforms.&lt;br /&gt;
 #   Assumes a very recent gcc-compatible compiler and assembler.&lt;br /&gt;
 #   (Gas prefetcht0 support was added around May 1999.)&lt;br /&gt;
 #   Empirically the code appears to still run correctly on Pentium II&lt;br /&gt;
 #   processors, though with no performance benefit.  May not run on other&lt;br /&gt;
 #   X86 processors?  In some cases this improves performance by&lt;br /&gt;
 #   15% or so.&lt;br /&gt;
 # -DUSE_3DNOW_PREFETCH causes the collector to issue AMD 3DNow style&lt;br /&gt;
 #   prefetch instructions.  Same restrictions as USE_I686_PREFETCH.&lt;br /&gt;
 #   Minimally tested.  Didn&amp;#039;t appear to be an obvious win on a K6-2/500.&lt;br /&gt;
 # -DGC_USE_LD_WRAP in combination with the old flags listed in README.linux&lt;br /&gt;
 #   causes the collector some system and pthread calls in a more transparent&lt;br /&gt;
 #   fashion than the usual macro-based approach.  Requires GNU ld, and&lt;br /&gt;
 #   currently probably works only with Linux.&lt;br /&gt;
 # -DTHREAD_LOCAL_ALLOC defines GC_local_malloc(), GC_local_malloc_atomic()&lt;br /&gt;
 #   and GC_local_gcj_malloc().  Needed for gc_gcj.h interface.  These allocate&lt;br /&gt;
 #   in a way that usually does not involve acquisition of a global lock.&lt;br /&gt;
 #   Currently requires -DGC_LINUX_THREADS, but should be easy to port to&lt;br /&gt;
 #   other pthreads environments.  Recommended for multiprocessors.&lt;br /&gt;
 # -DPARALLEL_MARK allows the marker to run in multiple threads.  Recommended&lt;br /&gt;
 #   for multiprocessors.  Currently requires Linux on X86 or IA64, though&lt;br /&gt;
 #   support for other Posix platforms should be fairly easy to add,&lt;br /&gt;
 #   if the thread implementation is otherwise supported.&lt;br /&gt;
 # -DNO_GETENV prevents the collector from looking at environment variables.&lt;br /&gt;
 #   These may otherwise alter its configuration, or turn off GC altogether.&lt;br /&gt;
 #   I don&amp;#039;t know of a reason to disable this, except possibly if the&lt;br /&gt;
 #   resulting process runs as a privileged user?&lt;br /&gt;
 # -DUSE_GLOBAL_ALLOC.  Win32 only.  Use GlobalAlloc instead of&lt;br /&gt;
 #   VirtualAlloc to allocate the heap.  May be needed to work around&lt;br /&gt;
 #   a Windows NT/2000 issue.  Incompatible with USE_MUNMAP.&lt;br /&gt;
 #   See README.win32 for details.&lt;br /&gt;
 # -DMAKE_BACK_GRAPH. Enable GC_PRINT_BACK_HEIGHT environment variable.&lt;br /&gt;
 #   See README.environment for details.  Experimental. Limited platform&lt;br /&gt;
 #   support.  Implies DBG_HDRS_ALL.  All allocation should be done using&lt;br /&gt;
 #   the debug interface.&lt;br /&gt;
 # -DSTUBBORN_ALLOC allows allocation of &amp;quot;hard to change&amp;quot; objects, and thus&lt;br /&gt;
 #   makes incremental collection easier.  Was enabled by default until 6.0.&lt;br /&gt;
 #   Rarely used, to my knowledge.&lt;br /&gt;
 # -DHANDLE_FORK attempts to make GC_malloc() work in a child process fork()ed&lt;br /&gt;
 #   from a multithreaded parent.  Currently only supported by linux_threads.c.&lt;br /&gt;
 #   (Similar code should work on Solaris or Irix, but it hasn&amp;#039;t been tried.)&lt;br /&gt;
&lt;br /&gt;
= 사용법 =&lt;br /&gt;
== 인터페이스 ==&lt;br /&gt;
* [http://www.hpl.hp.com/personal/Hans_Boehm/gc/gcinterface.html 설명]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
contributor [[lostship]]&lt;br /&gt;
----&lt;br /&gt;
[[도구분류]]&lt;br /&gt;
&lt;/div&gt;</summary>
		<author><name>imported&gt;Unknown</name></author>
	</entry>
</feed>