That comment is in the context when _cxa_get_globals() and 
_cxa_get_globals_fast() are different.  In the single threaded and thread local 
case, they are the same.

Background: there was originally just _cxa_get_globals().  But it had to always 
check if the global had been allocated for the current thread.  Someone 
realized extra check was a waste of performance, given the way it was used in 
the unwinder. The only way to get into the bowels of the unwinder was to pass 
through some code that already called _cxa_get_globals(). Therefore, there were 
uses that did not need the allocation check.  So, _cxa_get_globals_fast() was 
created which was exactly the same, except did not check for allocation.  Then 
someone said, what if someone refactors the unwinder and forgets to make sure 
_cxa_get_globals() was called before _cxa_get_globals()?  Adding an assert in 
_cxa_get_globals_fast would slow down the unwinder in the case that is supposed 
to be fast.  So, instead they decided to return NULL which should immediately 
cause a bus error on use.  

None of that applies to the single threaded and thread local cases.

http://reviews.llvm.org/D3386



_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to