[fix](memory) Fix bthread_setspecific log fatal on UBSAN build (#18274)
This commit is contained in:
@ -191,6 +191,11 @@ private:
|
||||
TUniqueId _fragment_instance_id;
|
||||
};
|
||||
|
||||
#if defined(UNDEFINED_BEHAVIOR_SANITIZER)
|
||||
static ThreadContext* thread_context() {
|
||||
return thread_context_ptr._ptr;
|
||||
}
|
||||
#else
|
||||
// Cache the pointer of bthread local in pthead local,
|
||||
// Avoid calling bthread_getspecific frequently to get bthread local, which has performance problems.
|
||||
static void pthread_attach_bthread() {
|
||||
@ -225,6 +230,7 @@ static ThreadContext* thread_context() {
|
||||
return thread_context_ptr._ptr;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
class ScopeMemCount {
|
||||
public:
|
||||
|
||||
Reference in New Issue
Block a user