record alloc lbt in slice
This commit is contained in:
@ -36,6 +36,14 @@ using namespace oceanbase::share;
|
||||
namespace storage
|
||||
{
|
||||
|
||||
#ifdef OB_ENABLE_SLICE_ALLOC_LEAK_DEBUG
|
||||
#define TX_DATA_MEM_LEAK_DEBUG_CODE slice_allocator_.enable_leak_debug();
|
||||
#else
|
||||
#define TX_DATA_MEM_LEAK_DEBUG_CODE
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
int ObTxDataTable::init(ObLS *ls, ObTxCtxTable *tx_ctx_table)
|
||||
{
|
||||
int ret = OB_SUCCESS;
|
||||
@ -58,6 +66,7 @@ int ObTxDataTable::init(ObLS *ls, ObTxCtxTable *tx_ctx_table)
|
||||
STORAGE_LOG(WARN, "init tx data read ctx failed.", KR(ret), K(tablet_id_));
|
||||
} else {
|
||||
slice_allocator_.set_nway(ObTxDataTable::TX_DATA_MAX_CONCURRENCY);
|
||||
TX_DATA_MEM_LEAK_DEBUG_CODE
|
||||
|
||||
ls_ = ls;
|
||||
memtable_mgr_ = static_cast<ObTxDataMemtableMgr *>(memtable_mgr_handle.get_memtable_mgr());
|
||||
@ -318,7 +327,11 @@ int ObTxDataTable::alloc_undo_status_node(ObUndoStatusNode *&undo_status_node)
|
||||
{
|
||||
int ret = OB_SUCCESS;
|
||||
void *slice_ptr = nullptr;
|
||||
#ifdef OB_ENABLE_SLICE_ALLOC_LEAK_DEBUG
|
||||
if (OB_ISNULL(slice_ptr = slice_allocator_.alloc(true /*record_alloc_lbt*/))) {
|
||||
#else
|
||||
if (OB_ISNULL(slice_ptr = slice_allocator_.alloc())) {
|
||||
#endif
|
||||
ret = OB_ALLOCATE_MEMORY_FAILED;
|
||||
STORAGE_LOG(WARN, "allocate memory fail.", KR(ret), KP(this), K(tablet_id_));
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user