Torrie Fischer 6614a48418 Refactor PerfStepTimer to stop on destruct
This eliminates the need to remember to call PERF_TIMER_STOP when a section has
been timed. This allows more useful design with the perf timers and enables
possible return value optimizations. Simplistic example:

class Foo {
  public:
    Foo(int v) : m_v(v);
  private:
    int m_v;
}

Foo makeFrobbedFoo(int *errno)
{
  *errno = 0;
  return Foo();
}

Foo bar(int *errno)
{
  PERF_TIMER_GUARD(some_timer);

  return makeFrobbedFoo(errno);
}

int main(int argc, char[] argv)
{
  Foo f;
  int errno;

  f = bar(&errno);

  if (errno)
    return -1;
  return 0;
}

After bar() is called, perf_context.some_timer would be incremented as if
Stop(&perf_context.some_timer) was called at the end, and the compiler is still
able to produce optimizations on the return value from makeFrobbedFoo() through
to main().
2014-09-02 12:04:22 -07:00
..
2014-07-08 12:31:49 -07:00
2014-08-26 14:15:00 -07:00
2014-08-11 13:22:47 -04:00
2014-08-11 13:22:47 -04:00
2014-08-28 12:46:05 -04:00
2014-07-20 22:57:20 +08:00
2014-04-08 10:58:07 -07:00
2014-06-03 12:28:58 -07:00
2014-07-30 10:17:48 -07:00
2014-02-28 13:19:47 -08:00
2014-01-27 14:49:10 -08:00
2014-03-14 22:44:35 +00:00
2014-03-14 13:02:20 -07:00
2014-08-25 14:24:09 -07:00
2014-01-30 22:10:10 -08:00
2014-04-15 13:39:26 -07:00