<?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: ^ Blocks Tips &amp; Tricks</title>
	<atom:link href="http://www.friday.com/bbum/2009/08/29/blocks-tips-tricks/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.friday.com/bbum/2009/08/29/blocks-tips-tricks/</link>
	<description>...so google can index my head.</description>
	<lastBuildDate>Thu, 02 Sep 2010 06:25:06 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
	<item>
		<title>By: Jonathan Lehr</title>
		<link>http://www.friday.com/bbum/2009/08/29/blocks-tips-tricks/comment-page-1/#comment-191564</link>
		<dc:creator>Jonathan Lehr</dc:creator>
		<pubDate>Sat, 12 Sep 2009 16:53:49 +0000</pubDate>
		<guid isPermaLink="false">http://www.friday.com/bbum/?p=1505#comment-191564</guid>
		<description>Thanks for the great article! One minor note: The Grand Central Dispatch technology brief linked at the top appears to have been superseded by a later version, and because the date is incorporated in the filename the older link doesn&#039;t work anymore. Here&#039;s a link to the updated file:

     http://images.apple.com/macosx/technology/docs/GrandCentral_TB_brief_20090903.pdf</description>
		<content:encoded><![CDATA[<p>Thanks for the great article! One minor note: The Grand Central Dispatch technology brief linked at the top appears to have been superseded by a later version, and because the date is incorporated in the filename the older link doesn&#8217;t work anymore. Here&#8217;s a link to the updated file:</p>
<p>     <a href="http://images.apple.com/macosx/technology/docs/GrandCentral_TB_brief_20090903.pdf" >http://images.apple.com/macosx/technology/docs/GrandCentral_TB_brief_20090903.pdf</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ben Holt</title>
		<link>http://www.friday.com/bbum/2009/08/29/blocks-tips-tricks/comment-page-1/#comment-191428</link>
		<dc:creator>Ben Holt</dc:creator>
		<pubDate>Sun, 30 Aug 2009 21:39:11 +0000</pubDate>
		<guid isPermaLink="false">http://www.friday.com/bbum/?p=1505#comment-191428</guid>
		<description>One potential gotcha regarding recursive blocks (example 7):  if the block might be copied for any reason or could outlive the scope of the current stack frame, you must store a &lt;i&gt;copy&lt;/i&gt; of the block in your reference variable.</description>
		<content:encoded><![CDATA[<p>One potential gotcha regarding recursive blocks (example 7):  if the block might be copied for any reason or could outlive the scope of the current stack frame, you must store a <i>copy</i> of the block in your reference variable.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joachim Bengtsson</title>
		<link>http://www.friday.com/bbum/2009/08/29/blocks-tips-tricks/comment-page-1/#comment-191418</link>
		<dc:creator>Joachim Bengtsson</dc:creator>
		<pubDate>Sat, 29 Aug 2009 18:37:38 +0000</pubDate>
		<guid isPermaLink="false">http://www.friday.com/bbum/?p=1505#comment-191418</guid>
		<description>As an addition to #2 and #5 is the case of storing a block in a collection like NSArray or NSDictionary longer than the block will survive on the stack; since they all use -[retain], the block needs to be moved to the heap first, like so:

NSArray *thingsToDo = [NSArray arrayWithObjects:
  [[^ { NSLog(@&quot;Hello&quot;); } copy] autorelease],
  [[^ { NSLog(@&quot;World!&quot;); } copy] autorelease],
nil];

I write about that and more in my own blocks guide over at http://thirdcog.eu/pwcblocks/ :)</description>
		<content:encoded><![CDATA[<p>As an addition to #2 and #5 is the case of storing a block in a collection like NSArray or NSDictionary longer than the block will survive on the stack; since they all use -[retain], the block needs to be moved to the heap first, like so:</p>
<p>NSArray *thingsToDo = [NSArray arrayWithObjects:<br />
  [[^ { NSLog(@"Hello"); } copy] autorelease],<br />
  [[^ { NSLog(@"World!"); } copy] autorelease],<br />
nil];</p>
<p>I write about that and more in my own blocks guide over at <a href="http://thirdcog.eu/pwcblocks/" >http://thirdcog.eu/pwcblocks/</a> <img src='http://www.friday.com/bbum/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John C. Randolph</title>
		<link>http://www.friday.com/bbum/2009/08/29/blocks-tips-tricks/comment-page-1/#comment-191417</link>
		<dc:creator>John C. Randolph</dc:creator>
		<pubDate>Sat, 29 Aug 2009 18:18:09 +0000</pubDate>
		<guid isPermaLink="false">http://www.friday.com/bbum/?p=1505#comment-191417</guid>
		<description>Thanks, yuji. I wasn&#039;t clear on that.

-jcr</description>
		<content:encoded><![CDATA[<p>Thanks, yuji. I wasn&#8217;t clear on that.</p>
<p>-jcr</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: yuji</title>
		<link>http://www.friday.com/bbum/2009/08/29/blocks-tips-tricks/comment-page-1/#comment-191416</link>
		<dc:creator>yuji</dc:creator>
		<pubDate>Sat, 29 Aug 2009 16:42:17 +0000</pubDate>
		<guid isPermaLink="false">http://www.friday.com/bbum/?p=1505#comment-191416</guid>
		<description>No, only the context (captured local variables, etc.) of the block is on the stack. The code is still on the executable section. The context on the stack only has a pointer to the said code.</description>
		<content:encoded><![CDATA[<p>No, only the context (captured local variables, etc.) of the block is on the stack. The code is still on the executable section. The context on the stack only has a pointer to the said code.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John C. Randolph</title>
		<link>http://www.friday.com/bbum/2009/08/29/blocks-tips-tricks/comment-page-1/#comment-191412</link>
		<dc:creator>John C. Randolph</dc:creator>
		<pubDate>Sat, 29 Aug 2009 11:17:11 +0000</pubDate>
		<guid isPermaLink="false">http://www.friday.com/bbum/?p=1505#comment-191412</guid>
		<description>So, it seems to me that since blocks are allocated on the stack, and they&#039;re executable, using them means the stack can&#039;t be in memory that&#039;s marked as non-executable.   Is this a security hazard, or are the classic stack-smashing attacks a non-issue these days?

-jcr</description>
		<content:encoded><![CDATA[<p>So, it seems to me that since blocks are allocated on the stack, and they&#8217;re executable, using them means the stack can&#8217;t be in memory that&#8217;s marked as non-executable.   Is this a security hazard, or are the classic stack-smashing attacks a non-issue these days?</p>
<p>-jcr</p>
]]></content:encoded>
	</item>
</channel>
</rss>
