<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Oasis Feng &#187; Leave</title>
	<atom:link href="http://blog.oasisfeng.com/tag/leave/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.oasisfeng.com</link>
	<description>Challenge your imagination!</description>
	<lastBuildDate>Sun, 22 Aug 2010 18:15:48 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
<atom:link rel="hub" href="http://pubsubhubbub.appspot.com"/><atom:link rel="hub" href="http://superfeedr.com/hubbub"/>		<item>
		<title>在栈空间敏感的环境中应谨慎使用TRAP()</title>
		<link>http://blog.oasisfeng.com/2007/11/03/save-stack-for-symbian-trap/</link>
		<comments>http://blog.oasisfeng.com/2007/11/03/save-stack-for-symbian-trap/#comments</comments>
		<pubDate>Sat, 03 Nov 2007 02:26:39 +0000</pubDate>
		<dc:creator>oasisfeng</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Symbian]]></category>
		<category><![CDATA[Leave]]></category>
		<category><![CDATA[Stack]]></category>
		<category><![CDATA[TRAP]]></category>
		<category><![CDATA[TRAPD]]></category>
		<category><![CDATA[栈]]></category>

		<guid isPermaLink="false">http://blog.oasisfeng.com/2007/11/03/save-stack-for-symbian-trap/</guid>
		<description><![CDATA[最近在优化一个函数的栈使用中，意外的发现以前一直被忽略的一个消耗源，那就是TRAP()宏。作为Symbian编程基石之一的TRAP/Leave在已经被很多人当作C++的try{throw}catch一样使用的时候，你是否意识到这个宏会消耗多达76字节的栈空间？如果使用的是TRAPD()版本，则这个数字将达到80字节。倘若函数中用了不止一次的话，栈消耗将相当可观。 除了认真审视函数上下文中是否有使用TRAP()的必要（有些时候直接往上传递Leave也未尝不可）， 可能更多的时候是难以避免使用TRAP()的，那么如何才能尽量节省栈空间呢？这里有一个简单的方法，那就是把TRAP()宏拆开来，在一个函数内使用共享的TTrap对象。 如果你也被Symbian那点可怜的栈空间困扰，不妨也关注一下程序中TRAP()/TRAPD()的使用吧。]]></description>
			<content:encoded><![CDATA[<p>最近在优化一个函数的栈使用中，意外的发现以前一直被忽略的一个消耗源，那就是TRAP()宏。作为Symbian编程基石之一的TRAP/Leave在已经被很多人当作C++的try{throw}catch一样使用的时候，你是否意识到这个宏会消耗多达76字节的栈空间？如果使用的是TRAPD()版本，则这个数字将达到80字节。倘若函数中用了不止一次的话，栈消耗将相当可观。</p>
<p>除了认真审视函数上下文中是否有使用TRAP()的必要（有些时候直接往上传递Leave也未尝不可）， 可能更多的时候是难以避免使用TRAP()的，那么如何才能尽量节省栈空间呢？这里有一个简单的方法，那就是把TRAP()宏拆开来，在一个函数内使用共享的TTrap对象。</p>
<p>如果你也被Symbian那点可怜的栈空间困扰，不妨也关注一下程序中TRAP()/TRAPD()的使用吧。</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.oasisfeng.com/2007/11/03/save-stack-for-symbian-trap/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.222 seconds -->
