Chinaunix首页 | 论坛 | 博客
  • 博客访问: 746189
  • 博文数量: 116
  • 博客积分: 923
  • 博客等级: 准尉
  • 技术积分: 1635
  • 用 户 组: 普通用户
  • 注册时间: 2011-10-06 21:43
个人简介

一直帮老板搬运代码!!!

文章分类
文章存档

2013年(47)

2012年(69)

分类: WINDOWS

2012-08-05 19:38:47

The __leave keyword

The __leave keyword is valid within a try-finally statement block. The effect of __leave is to jump to the end of the try-finally block. The termination handler is immediately executed. Although a goto statement can be used to accomplish the same result, a goto statement causes stack unwinding. The __leave statement is more efficient because it does not involve stack unwinding.

__try/__finally在使用时,如果在__try块中有goto、return等语句会引起局部展开(local   unwind),影响程序效率,所以在__try快中使用__leave
 
总之:__leave跳出try-finally块,goto会造成栈的释放,而__leave不会造成释放,从而提高效率。
阅读(2166) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~