================ Comment at: src/cxa_exception_storage.cpp:48 @@ +47,3 @@ +#if LIBCXXABI_SINGLE_THREADED + __cxa_eh_globals * eh_globals_ = NULL; +#else ---------------- [email protected] wrote: > Why is eh_globals_ being allocated with calloc() in the single threaded case? > > This would be much simpler to have a block (like the #if HAS_THREAD_LOCAL) > that just has: > > #elif LIBCXXABI_SINGLE_THREADED > static __cxa_eh_globals eh_globals; > __cxa_eh_globals *_cxa_get_globals() { return &eh_globals; } > __cxa_eh_globals *_cxa_get_globals_fast() { return &eh_globals; } > #else > > and the rest of the file stays the same. There's a comment above __cxa_get_globals_fast() saying that it has to return 0 if __cxa_get_globals() wasn't called first (which might be a bug in the HAS_THREAD_LOCAL side?).
Good point though, structuring it like that will make it cleaner. http://reviews.llvm.org/D3386 _______________________________________________ cfe-commits mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
