top | item 6659146

(no title)

Tibbes | 12 years ago

Does anyone know the purpose of the self-assignment on page 3? (in the body of IsWriteCombined)

  DWORD error = GetLastError();
  error = error

discuss

order

corysama|12 years ago

I often do that just to have a statement on which to place a breakpoint. It gets optimized out, but in debug builds it works fine. Putting a breakpoint on a line that just deals with the error code immediately after the error code will reliably display the error in the Auto Variables watch window in VStudio maligning it very convenient for rapid debugging.