On Thu, 28 Jan 2010 02:53:56 Jay Pipes wrote: > Tim Penhey wrote: > > As part of the refactoring I'm doing on drizzled/error.cc, I'm > > considering doing the primary initialization of the enum -> error string > > at static initialization time. > > > > Are there any concerns about this? > > Any reason behind this?
Both the main drizzle server and the client applications need to initialize the error code -> string mapping. Since this initialization is solely creating a map of uint_32 -> std::string into a drizzle::hash_map, this is not going to error in weird and wonderful ways. By doing this at static initialization time you can remove the need to call the init_errors function, of which there are two init_glob_err and init_errmessage. Also the destruction of the static hash map is all taken care of too, and doesn't need an explicit call. The alternative is to keep a global function that does this initialization. I just felt it was easier to ask before I started changing this bit. Tim _______________________________________________ Mailing list: https://launchpad.net/~drizzle-discuss Post to : [email protected] Unsubscribe : https://launchpad.net/~drizzle-discuss More help : https://help.launchpad.net/ListHelp

