<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Nested functions in GCC</title>
	<atom:link href="http://www.weaselhat.com/2010/03/03/nested-functions-in-gcc/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.weaselhat.com/2010/03/03/nested-functions-in-gcc/</link>
	<description></description>
	<lastBuildDate>Tue, 25 Oct 2011 15:23:07 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Zjzzzjz</title>
		<link>http://www.weaselhat.com/2010/03/03/nested-functions-in-gcc/comment-page-1/#comment-497</link>
		<dc:creator>Zjzzzjz</dc:creator>
		<pubDate>Mon, 15 Mar 2010 20:38:48 +0000</pubDate>
		<guid isPermaLink="false">http://www.weaselhat.com/?p=208#comment-497</guid>
		<description>Is your laptop on Mac? If so, this might be the reason... Because I think nested-function is only working with Mac now, it basically comes from &#039;block function&#039; in ObjectC.

I just wanted to know how the local variables in the closure are stored. From your code, every time f is called, a fresh function pointer to that nested function is returned, where the local variables on f&#039;s stack must be stored some where. I guess they must be on heap. But how is this memory space on heap released? since there is no GC in GCC, if we call f&#039; zillions of times, will it use all of the memory space...?</description>
		<content:encoded><![CDATA[<p>Is your laptop on Mac? If so, this might be the reason&#8230; Because I think nested-function is only working with Mac now, it basically comes from &#8216;block function&#8217; in ObjectC.</p>
<p>I just wanted to know how the local variables in the closure are stored. From your code, every time f is called, a fresh function pointer to that nested function is returned, where the local variables on f&#8217;s stack must be stored some where. I guess they must be on heap. But how is this memory space on heap released? since there is no GC in GCC, if we call f&#8217; zillions of times, will it use all of the memory space&#8230;?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michael Greenberg</title>
		<link>http://www.weaselhat.com/2010/03/03/nested-functions-in-gcc/comment-page-1/#comment-496</link>
		<dc:creator>Michael Greenberg</dc:creator>
		<pubDate>Mon, 15 Mar 2010 20:15:32 +0000</pubDate>
		<guid isPermaLink="false">http://www.weaselhat.com/?p=208#comment-496</guid>
		<description>I was using my laptop&#039;s OS X build of gcc.  It doesn&#039;t work on any of the CETS machines for me, either.</description>
		<content:encoded><![CDATA[<p>I was using my laptop&#8217;s OS X build of gcc.  It doesn&#8217;t work on any of the CETS machines for me, either.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Zjzzzjz</title>
		<link>http://www.weaselhat.com/2010/03/03/nested-functions-in-gcc/comment-page-1/#comment-495</link>
		<dc:creator>Zjzzzjz</dc:creator>
		<pubDate>Mon, 15 Mar 2010 19:28:07 +0000</pubDate>
		<guid isPermaLink="false">http://www.weaselhat.com/?p=208#comment-495</guid>
		<description>How did you get it compiled in that day? My Eniac GCC does not like this option -fnested-function or -fnested-functions:

cc1: error: unrecognized command line option &quot;-fnested-function&quot;
cc1: error: unrecognized command line option &quot;-fnested-functions&quot;

...</description>
		<content:encoded><![CDATA[<p>How did you get it compiled in that day? My Eniac GCC does not like this option -fnested-function or -fnested-functions:</p>
<p>cc1: error: unrecognized command line option &#8220;-fnested-function&#8221;<br />
cc1: error: unrecognized command line option &#8220;-fnested-functions&#8221;</p>
<p>&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michael Greenberg</title>
		<link>http://www.weaselhat.com/2010/03/03/nested-functions-in-gcc/comment-page-1/#comment-492</link>
		<dc:creator>Michael Greenberg</dc:creator>
		<pubDate>Wed, 03 Mar 2010 22:38:30 +0000</pubDate>
		<guid isPermaLink="false">http://www.weaselhat.com/?p=208#comment-492</guid>
		<description>Hadn&#039;t had a look at the manual (figures, doesn&#039;t it?), so I suppose all of these behaviors are out of spec anyway.  What troubles me about this is the existence of weird out of spec behaviors that are sometimes correct.  That, I suppose, is where your &quot;but it&#039;s C&quot; comment comes in.  Point taken. :)</description>
		<content:encoded><![CDATA[<p>Hadn&#8217;t had a look at the manual (figures, doesn&#8217;t it?), so I suppose all of these behaviors are out of spec anyway.  What troubles me about this is the existence of weird out of spec behaviors that are sometimes correct.  That, I suppose, is where your &#8220;but it&#8217;s C&#8221; comment comes in.  Point taken. :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ben Karel</title>
		<link>http://www.weaselhat.com/2010/03/03/nested-functions-in-gcc/comment-page-1/#comment-491</link>
		<dc:creator>Ben Karel</dc:creator>
		<pubDate>Wed, 03 Mar 2010 22:31:02 +0000</pubDate>
		<guid isPermaLink="false">http://www.weaselhat.com/?p=208#comment-491</guid>
		<description>But it&#039;s C; the compiler isn&#039;t going to do any transformations like closure- or assignment conversion that could violate the transparency of the cost model. The compilation model is simple: a nested function is a function pointer with access to the frame pointer of its lexical parent function.

And the manual does explicitly say &quot;If you try to call the nested function through its address after the containing function has exited, all hell will break loose.&quot; ;-)</description>
		<content:encoded><![CDATA[<p>But it&#8217;s C; the compiler isn&#8217;t going to do any transformations like closure- or assignment conversion that could violate the transparency of the cost model. The compilation model is simple: a nested function is a function pointer with access to the frame pointer of its lexical parent function.</p>
<p>And the manual does explicitly say &#8220;If you try to call the nested function through its address after the containing function has exited, all hell will break loose.&#8221; ;-)</p>
]]></content:encoded>
	</item>
</channel>
</rss>

