MachRegister::names construct on first use idiom wasn't.
authorNathan Rosenblum <nater@cs.wisc.edu>
Tue, 9 Aug 2011 21:23:07 +0000 (16:23 -0500)
committerAndrew Bernat <bernat@cumin.cs.wisc.edu>
Wed, 16 Nov 2011 23:02:00 +0000 (17:02 -0600)
commite48599d72de7ce69fe4b238fc60c2df2f8d19df9
treeb0a45fd08e19629b1f94833effec9259d581a523
parentf8614cdd6edc45b2f0e498d0808b630708f56460
MachRegister::names construct on first use idiom wasn't.

Two problems with MachRegister::names static map:

(1) Raw pointer use caused excessive & verbose valgrind
    leak output. The actual leak isn't a problem, but it
    makes looking for other leaks painful.

(2) The construct on use pattern used was incorrect, leaving
    the code at risk for improper static initialization.
    Static initialization of the MachRegister::names pointer
    races with intitialization via init_names() called in
    the header & can lead to duplicate initialization.
    Again, no "incorrect" behavior could result; just leads
    to overuse of memory.
common/src/dyn_regs.C
dynutil/h/dyn_regs.h