?????????????????????C++ only flag??/EHsc????????size?????
????Exe
????Obj
????37??888 bytes
????24??959 bytes
????????size???????????????20%??
?????????????????????????C++??throw??????????????????????????????????????windows SEH ????????????????????????????????line1??line7??Line8????????
???????г???“??0”????????3??????????????line4??????2???C++ throw ??????line7????
???????????????????“C++ ?? SHE ??/EHa??”??????size?????
????Exe
????Obj
????37.0 KB (37??888 bytes)
????28??486 bytes
???????? obj size ???б仯???????????????????????MyAppObject::DoSomething????????????????????
??????????????
????????????????????“????????working set??”?? ??????????20%???????????????????????????????????????????????????????????????????????????????????ɡ?
?????????TestMyAppObject?У?????C++?????????????????“?????”???????????????????TestMyAppObject?е?so??ss???? so2 ?????????????????????£?????????“???г???”??“????”??“???”??
???????磬TestMyAppObject????????before try ?? in try??
????TestMyAppObject?????line2 ~ line6 ?????line????????????
????TestMyAppObject?????????????
??????“stack unwinding (????????”??
???????line2??????????????????????MyAppObject ???в???δ?????????partially constructed member ??????
???????line3??????so?????????
???????line4??????so??ss???????????
???????line6??????so??ss????so2?????????
??????????catch?????catch
???????????????catch???????????溯??????????????
????VC++??stack unwinding??????????
??????????????????????????????jump?б???г?????????????jump to ????????????stack_unwind()????????????????????????????”???”????????б??????????????????????????
?????????????????????C++?У??????????auto????????????????????????????????????????jump?б?????3???size??????????????????????????????????????????????????????????????????????????????λ?????TestMyAppObject????????????????????????????????????????????????
????????????TestMyAppObject?????????????????????????????10%~15%??????????????????м?rethrow ???????????????????????????????
???????????????????????????auto????????????“????б?”size????? ??????????????б??ú????????????????????auto????????????
????X a?? b??
????Y c??d??
??????????
????X a??
????// do something ??1??
????X b;
????// do something else ??2??
????Y c;
????// do yet something else ??3??
????Y d;
???????????????????????????constructor ????throw??????????????????????????
??????????
????????????TestMyAppObject?????????1000?ε?????
???????0???line4??????????C++ throw)???????0.802??
???????1???line4????????????????0.832??
???????2???line4????????C++ throw)??????1000?β?????????1.043??
?????????????????й??
????C++ throw????????????windows SEH??C++ throw ?????????????????????????????20%?????????????throw????primitive ??????????????????????????????
?????????????????????????????????????????????????????????try-catch?????????????????????????stack-unwinding???????????????????????У??????????????????10%~15%????????????
????????????????OS?????汾??VC++????????????汾??????????????
???????
????????????C++?о???????????????????????????????ó???????????
???????????????????????????????trade off????????????????????????檔???????“???”?? ??????????????????????????????????????????????????????“??????? control construct”???á???????????????????????“???”????С????б??