----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: http://reviews.gem5.org/r/2164/#review4916 -----------------------------------------------------------
I like the idea. Could you generalize this and add a fatal_if? There are plenty of places where we do something like "if (param > foo) fatal(...);" Also, please add Doxygen documentation to the macros. - Andreas Sandberg On Feb. 21, 2014, 2:24 p.m., Andreas Hansson wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > http://reviews.gem5.org/r/2164/ > ----------------------------------------------------------- > > (Updated Feb. 21, 2014, 2:24 p.m.) > > > Review request for Default. > > > Repository: gem5 > > > Description > ------- > > Changeset 10077:ebe43d95c134 > --------------------------- > misc: Add panic_if replacement for if(foo) ... assert(!foo) > > This snippet can be used to replace asserts and have them behave like if + > panic constructs. The interface is as follows: > > panic_if(foo != bar, "These should be equal: foo %i bar %i", foo, bar); > > panic_unless would be a more straightforward replacement for assert, but is > more clumsy than panic_if(!foo,...). > > > Diffs > ----- > > src/base/misc.hh 2360411a16be > > Diff: http://reviews.gem5.org/r/2164/diff/ > > > Testing > ------- > > All regressions pass (as it does not affect existing code). > > > Thanks, > > Andreas Hansson > > _______________________________________________ gem5-dev mailing list [email protected] http://m5sim.org/mailman/listinfo/gem5-dev
