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)
committerEmily Jacobson <jacobson@gouda.cs.wisc.edu>
Thu, 20 Oct 2011 21:49:31 +0000 (16:49 -0500)
commit6374b7d71ee6e7c1874cfad44d2a4b87a7ec6e76
tree56a22c6479df777de24bd44b89fbcd34ba69da18
parentb94cc0900af8f7a20a522b19d1646c1342233a6d
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