On Friday 04 June 2010, William A. Rowe Jr. wrote:
> This seems to be a very good solution, and the fact that their are
> no constructor-time calls to initialize this should avoid any
> platform quirks.
> 
> My only question is; are we assured to have the same module_index
> reassigned on each config/reload phase?  The reason I'm worried is
> that this code won't refresh the index, but there may be platforms
> that don't actually do a module unload/reload/reinit heap of
> aplog_module_index to NULL.

Since we are only initializing a pointer into the module struct, it 
really does not matter if the module_index changes or not. If the 
module is not reloaded, the address of the module struct stays the 
same. If the module is reloaded, the pointer is reinitialized.

A module just must not use a module_struct for logging which is in a 
different module/shared object. This could lead to segfaults if the 
depended upon module is reloaded (if the runtime linker does not 
prevent unloading in this case anyway). But only using your own 
module_index for logging does not sound like a limitation to me.

Reply via email to