How to use RtlUnwindEx

Disclaimer:  I’ve never actually written an unwind personality routine, so take what’s here with a grain of salt. A few days back, I spent 30 minutes defending the C++ runtime’s exception handling personality routine to the guy that has the less than enviable job of supporting the .Net Framework’s exception handling personality routine.  The eventual…

1

AMD64 unwind info gotchas

I had a brief e-mail exchange with one of the devs on the optimizer team about a checkin he put up for review.  He modified the compiler so that it only aligns the stack for functions that call other functions – that’s the typical definition in compiler lingo of a ‘leaf function’.  My first response was “don’t…

1

New Job, SP1

I recently switched from the lead of the Code Gen & Tools team for Visual C++ to the lead for the Code Gen team for the .Net Framework.  I’ve not used managed code much, but for some classes of code, it sure does look easier to use [I’m working on a goofy GUI app for…

3

Speaking in ‘public’…

I’ll be hanging out with the cool kids at the Northwest C++ Users Group tomorrow night.  If you’re in the area, and want to heckle me, swing by.  We’ll be in building 40 at 6:30 PM.  My talk starts at 7:00 PM.  I’m talking about the actual runtime cost of exception handling for x64 and x86…

4

A more flexible array template [and the evolution of the idea]

{Disclaimer – I started with a bunch of code from boost::array – it’s a great implementation of the functionality it provides} While my day job doesn’t generally allow me to goof around with advanced C++ features, I still managed to find time to do so after the kids are in bed.  Mark & I were…

4

How to get CL.exe proxy filters (like STLFilt) working under VS2005

There’s a class of tools that lots of people write that replace cl.exe with a ‘wrapper’ to do things link pre-process a command line [perhaps adding particular -D arguments], or filtering the output to deal with things like psychotically complicated error messages from template metaprogramming. These tools tend to be incredibly useful, and also tend…

8

x64 ABI vs. x86 ABI (aka Calling Conventions for AMD64 & EM64T)

(This is an older post, with some mild cleanup, and fixed links) Before I start: ABI = Application Binary Interface – this is the spec that describes how to call functions, pass parameters, unwind the stack, handle exceptions, etc… It’s also sometimes call the ‘Calling Convention’ There is a persistent misconception among people who are…

14

Why isn’t __assume on for asserts in retail mode?

__assume and __forceinline were the first two features I implemented as a developer out of college.  I just resolved a bug as ‘By Design’ that asked the question posed in the title.  Here’s a brief explanation: First, __assume(n==x) basically tells the expression optimizer & the global optimizer in the compiler that n is being assigned…

3

X64 Unwind Information

I’ve had a fairly large number of e-mails with various people both inside & outside Microsoft explaining the AMD64 unwind data. I generally push them at the ABI documentation (which I’ve linked to in this entry). But the ABI documentation really requires a complete reading before you can really understand how the unwind information all…

5

How to make a no-inline inline function (and why you might want to)

The Windows folks had a problem with the AMD64 compiler last week.  The interference package is not quite as good as the x86 one, so when it sees something like this:   // header.h inline void foo(int a, int b, int c) {     bar(&a, &b, &c); }   // function.cpp #include “header.h” void func()…

2