fix malloc_sample_bt
This commit is contained in:
parent
20101d03dd
commit
93d27616e0
@ -162,16 +162,14 @@ inline bool ObMallocSampleKey::operator==(const ObMallocSampleKey &other) const
|
||||
return ret;
|
||||
}
|
||||
|
||||
#define ob_malloc_sample_backtrace(obj, size) \
|
||||
{ \
|
||||
if (OB_UNLIKELY(obj->on_malloc_sample_)) { \
|
||||
void *addrs[100]; \
|
||||
int bt_len = OB_BACKTRACE_M(addrs, ARRAYSIZEOF(addrs)); \
|
||||
MEMCPY(&obj->data_[size], (char*)addrs, AOBJECT_BACKTRACE_SIZE); \
|
||||
if (AOBJECT_BACKTRACE_COUNT > bt_len) { \
|
||||
reinterpret_cast<void*&>(obj->data_[size + bt_len * sizeof(void*)]) = nullptr; \
|
||||
} \
|
||||
} \
|
||||
#define ob_malloc_sample_backtrace(obj, size) \
|
||||
{ \
|
||||
if (OB_UNLIKELY(obj->on_malloc_sample_)) { \
|
||||
void *addrs[100] = {nullptr}; \
|
||||
int bt_len = OB_BACKTRACE_M(addrs, ARRAYSIZEOF(addrs)); \
|
||||
STATIC_ASSERT(AOBJECT_BACKTRACE_SIZE < sizeof(addrs), "AOBJECT_BACKTRACE_SIZE must be less than addrs!"); \
|
||||
MEMCPY(&obj->data_[size], (char*)addrs, AOBJECT_BACKTRACE_SIZE); \
|
||||
} \
|
||||
}
|
||||
} // end of namespace lib
|
||||
} // end of namespace oceanbase
|
||||
|
Loading…
x
Reference in New Issue
Block a user